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

Query expansion #12

Open
TusharAgey opened this issue Oct 24, 2017 · 1 comment
Open

Query expansion #12

TusharAgey opened this issue Oct 24, 2017 · 1 comment

Comments

@TusharAgey
Copy link
Owner

No description provided.

@sardapv
Copy link
Contributor

sardapv commented Nov 7, 2017

Taken from stackoverflow thread : best way for query expansion

way I'd do it is to define a file of synonyms, as described in the documentation here and maintain that file.

With this one I'd create my custom token filter and use them at indexing time. Probably not a huge performance hit if you'd do this at query time, but it's better to do it at indexing time. The response time at query time will be better.

As you see in the link I provided above, you can define a simple text file where you put something like:

ivory, creme, putty =>white
...
This means that for any ivory, creme, putty found at indexing time, ES will actually index white and that's it.

And the analyzer would look like this:
"analyzer" : { "synonym" : { "tokenizer" : "whitespace", "filter" : ["synonym"] } }, "filter" : { "synonym" : { "type" : "synonym", "synonyms_path" : "analysis/synonym.txt" } }

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

No branches or pull requests

2 participants