mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-14 07:39:03 +00:00
[ES Schema change] Multi-field search display_name to match words over ngram limit
This fixes searching for "Machiavellianism", 16 chars ("Machiavellianis", 15 chars, worked previously).
Does not (seem to!) break anything, but requires a re-indexing of ES.
This commit is contained in:
@@ -109,6 +109,8 @@ def search_elastic(term='', user=None, sort='id', order='desc',
|
||||
# Apply search term
|
||||
if term:
|
||||
s = s.query('simple_query_string',
|
||||
# Query both fields, latter for words with >15 chars
|
||||
fields=['display_name', 'display_name.fullword'],
|
||||
analyzer='my_search_analyzer',
|
||||
default_operator="AND",
|
||||
query=term)
|
||||
|
||||
Reference in New Issue
Block a user