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

Add filter option to term suggester #2842

Closed
martijnvg opened this issue Apr 2, 2013 · 8 comments
Closed

Add filter option to term suggester #2842

martijnvg opened this issue Apr 2, 2013 · 8 comments

Comments

@martijnvg
Copy link
Member

Add optional filter option to term suggester, that only allows suggest options that match with the filter.

@julianhille
Copy link

What exactly is meant with that?

  1. have some kind of regex, script etc filter which filters out suggestions after these are generated and reduce them
    OR
  2. pre filter the documents on which the suggestions are based or even only to a "_type" in the index?

@nik9000
Copy link
Member

nik9000 commented Oct 25, 2013

Similar but not a duplicate of #3482.

@martijnvg
Copy link
Member Author

@julianhille This means that a term will only be suggested, if the documents that have this term also match with the provided filter. At least one of the term's document need to be in the filter.

This can best be seen as a kind of post filtering of terms. A _type in the index could be turn into a filter.

@julianhille
Copy link

@martijnvg then this is exactly what i need. Also for the autocomplete. I was unsure about the type of filter (pre, post) because both is named filter or known in the filter context. Sorry if that was clear to anyone else.

@bigerock
Copy link

i need this as well. i think the suggestions should be responsive to your overall query including filters, etc. i'm not sure where it would make sense to suggest terms outside of these parameters. for example, if i have a movies index and i am asking for children's movies (rated G), and i search on 'frozen', i don't want the suggester to suggest some rated R movie that also happens to contain the word 'frozen'.

@clintongormley
Copy link

@bigerock Why not use the phrase suggester instead? It does everything that the term suggester does, and more. And also supports filtering - see #3482

@bigerock
Copy link

apologies, pius sent me to this link. i am actually already using a phrase suggester but it's not adhering to my filters. perhaps there's something wrong with the structure of my query.

@ppf2
Copy link
Member

ppf2 commented Jul 30, 2014

@bigerock I think it is not working in your case because NEST does not yet support this (elastic/elasticsearch-net#824). Will chat more in our existing ZD ticket.

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

6 participants