Koha/admin/searchengine/elasticsearch/index_config.yaml
Fridolin Somers 90ef5ec8c8
Bug 30882: Add max_result_window to index config
Elasticsearch number of results is by default limited by setting "index.max-result-window", default value is 10000.
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-result-window

We use this setting:
44d6528b56/Koha/SearchEngine/Elasticsearch/Search.pm (L411)

I propose we add this setting in index config.

Test plan:
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes: misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check the settings of index (when using koha-testing-docker*):
   curl 'es:9200/koha_kohadev_biblios/_settings?pretty&filter_path=**.max_result_window'
5) You should see:
   "max_result_window" : "1000000"

* You also need to add this setting to the es section in koha-testing-docker's
docker-compose.yml (after the networks configuration):
     ports:
         - "9200:9300"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-07-18 11:23:03 -03:00

47 lines
1.4 KiB
YAML

---
# Index configuration that defines how different analyzers work.
index:
analysis:
analyzer:
# Phrase analyzer is used for phrases (exact phrase match)
analyzer_phrase:
tokenizer: keyword
filter:
- icu_folding
char_filter:
- punctuation
analyzer_standard:
tokenizer: icu_tokenizer
filter:
- icu_folding
analyzer_stdno:
tokenizer: whitespace
filter:
- icu_folding
char_filter:
- punctuation
normalizer:
icu_folding_normalizer:
type: custom
filter:
- icu_folding
nfkc_cf_normalizer:
type: custom
char_filter: icu_normalizer
facet_normalizer:
char_filter: facet
char_filter:
# The punctuation filter is used to remove any punctuation chars in fields that don't use icu_tokenizer.
punctuation:
type: pattern_replace
# The pattern contains all ASCII punctuation characters.
pattern: '([\x00-\x1F,\x21-\x2F,\x3A-\x40,\x5B-\x60,\x7B-\x89,\x8B,\x8D,\x8F,\x90-\x99,\x9B,\x9D,\xA0-\xBF,\xD7,\xF7])'
replacement: ''
facet:
type: pattern_replace
pattern: '\s*(?<!\p{Lu})[.\-,;]*\s*$'
replacement: ''
index.mapping.total_fields.limit: 10000
index.max_result_window: 1000000
index.number_of_replicas: 1
index.number_of_shards: 5