Skip to content
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

Consider using ElasticSearch's suggesters and/or fuzziness on search #22

Open
raquelalegre opened this issue Jun 5, 2019 · 2 comments
Labels
search Search process and code

Comments

@raquelalegre
Copy link
Contributor

ElasticSearch provides some functionality we could use to present users with suggestions when they mistype words. Have a look at Suggesters and Fuzzy Queries. Note those two link to ES 7.1, and I'm not sure which ES version we are using right now :)

@ageorgou
Copy link
Contributor

ageorgou commented Jun 7, 2019

In particular for search-as-you-type suggestions, we may want a combination of a completion suggester and a term suggester (for misspellings). Although the completion suggester also has a fuzziness setting, which may be enough.

The term suggester seems simple to add. The completion one requires some setup at index time, and maybe some configuration (e.g. filtering the _source to reduce data size, as suggested in the docs). We should be able to use both at the same time with a single query. The elasticsearch_dsl library doesn't seem to have a special API for suggestions, but we can just use the normal search() method.

The other option for completion suggestions is storing shingles/ngrams at index time, although that seems more involved (and I haven't found any docs for more recent versions). There is also apparently a search-as-you-type field type coming in future versions.

ageorgou added a commit that referenced this issue Jun 12, 2019
@ageorgou ageorgou added the search Search process and code label Jun 12, 2019
ageorgou added a commit that referenced this issue Nov 8, 2019
@ageorgou
Copy link
Contributor

ageorgou commented Nov 8, 2019

A useful tutorial for setting up a completion suggester (even though the interface has changed slightly, the steps seem to be the same).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search Search process and code
Projects
None yet
Development

No branches or pull requests

2 participants