Add an opt-in option to lowercase filter values

Filter values that only differ in case, like `Mint` and `mint`, came
through as separate values. The new `--lowercase-filters` option
(`lowercase_filters`, `PAGEFIND_LOWERCASE_FILTERS`, and
`lowercaseFilters` / `lowercase_filters` in the Node and Python
wrappers) lowercases filter values when indexing and merges values on
a page that become equal. Filter names are left as they are. Off by
default.

Fixes #737
This commit is contained in:
dualfroz committed 2026-10-03 01:43:17 +02:00
1 parent 1308f3c1bb
commit 3a1d31147a
12 files changed
+176

No files matched your search

+1
View File
@@ -59,6 +59,7 @@ export const createIndex = (config) => new Promise((resolve, reject) => {
keep_index_url: config?.keepIndexUrl,
write_playground: config?.writePlayground,
include_characters: config?.includeCharacters,
lowercase_filters: config?.lowercaseFilters,
}
}, (response) => {
/** @type {function(InternalResponsePayload): Omit<NewIndexResponse, 'errors'>?} */
+4
View File
@@ -56,6 +56,10 @@ export interface PagefindServiceConfig {
* @example "<>$"
*/
includeCharacters?: string,
/**
* Lowercase filter values when indexing, so that values differing only in case are merged into one.
*/
lowercaseFilters?: boolean,
}
+1
View File
@@ -34,6 +34,7 @@ export interface InternalPagefindServiceConfig {
keep_index_url?: boolean,
write_playground?: boolean,
include_characters?: string,
lowercase_filters?: boolean,
}
export interface InternalAddFileRequest {
@@ -59,6 +59,8 @@ class IndexConfig(TypedDict, total=False):
Useful for sites documenting technical topics such as programming languages.
"""
lowercase_filters: Optional[bool]
"""Lowercase filter values when indexing, so that values differing only in case are merged into one."""
output_path: Optional[str]
"""
The folder to output the search bundle into, relative to the processed site.
@@ -22,6 +22,7 @@ class InternalPagefindServiceConfig(TypedDict, total=False):
keep_index_url: Optional[bool]
write_playground: Optional[bool]
include_characters: Optional[str]
lowercase_filters: Optional[bool]
class InternalNewIndexRequest(TypedDict):