-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(autocomplete): improve full text search #9
base: master
Are you sure you want to change the base?
Conversation
'multi_match:full_text_search_fuzzy:fuzziness': 'AUTO', // (equivalent to AUTO:3,6) | ||
'multi_match:full_text_search_fuzzy:boost': 1, | ||
'multi_match:full_text_search_fuzzy:minimum_should_match': '2<90%', | ||
'multi_match:full_text_search_fuzzy:prefix_length': 0, | ||
'multi_match:full_text_search_fuzzy:max_expansions': 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On peut régler les paramètres dans le 2eme multimatch (avec fuzziness) ici.
La clé doit commencer par multi_match:full_text_search_fuzzy:
et on y ajoute un TERM
La liste des valeurs possibles pour TERM
: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#type-best-fields
Pour info, il y a une sorte de validation faite sur pelias/query pour n'ajouter que les TERM disponibles en fonction du type (best_fields
). Donc si on met n'importe quoi, le terme ne sera pas ajouté dans la query.
return subview(vsCopy); | ||
const vsFuzzy = new peliasQuery.Vars(vs.export()); | ||
vsFuzzy.var(`multi_match:${viewFuzzy}:input`).set(input); | ||
vsFuzzy.var(`multi_match:${viewFuzzy}:fields`).set(fields.map((field) => `pure.${field}`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On fait la recherche sur le champ pure.*
(pure.name.en
par exemple).
pure
est le template dynamique configuré sur geospike
bool: { | ||
should: [ | ||
multiMatchView(vsCopy), | ||
multiMatchFuzzyView(vsFuzzy) | ||
] | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suite aux recommendations de Damien pour une version non ngrammée, on passe par 2 multimatch (1 avec fuzzy, 1 sans) sous un bool
et should
'multi_match:full_text_search:type': 'best_fields', // (default value in ES) | ||
'multi_match:full_text_search:fuzziness': 'AUTO', // (equivalent to AUTO:3,6) | ||
'multi_match:full_text_search:minimum_should_match': '2<90%', | ||
'multi_match:full_text_search:boost': 1, | ||
'multi_match:full_text_search:field': 'name.default', | ||
'multi_match:full_text_search:prefix_length': 0, | ||
'multi_match:full_text_search:max_expansions': 50, | ||
'multi_match:full_text_search:zero_terms_query': 'NONE', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour les paramètres du 1er multimatch (sans fuzziness), on utilise la clé multi_match:full_text_search:
7374c70
to
c5c4ee0
Compare
No description provided.