1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 15:10:01 +00:00

Optimize Elasticsearch fullword field

Since the main display_name field ngrams words up to 15 characters,
anything to and under that will already be indexed - the fullword field
(which we have for words longer than 15 characters) needs to index only
words longer than that.
This commit is contained in:
TheAMM 2018-04-13 14:37:01 +03:00
parent 81806d7bc9
commit f31af836d9

View file

@ -32,13 +32,19 @@ settings:
filter:
- lowercase
- word_delimit
# These should be enough, as my_index_analyzer will match the rest
# Skip tokens shorter than N characters,
# since they're already indexed in the main field
- fullword_min
filter:
my_ngram:
type: edgeNGram
min_gram: 1
max_gram: 15
fullword_min:
type: length
# Remember to change this if you change the max_gram below!
min: 16
resolution:
type: pattern_capture
patterns: ["(\\d+)[xX](\\d+)"]