Hi all - I see that _suggest API has been introduced recently although it
is still in experiment phase. I am wondering if there is a way to specify
filter in the suggest API. This is to ensure that the suggestions are
confined based on the specified filter.
I tried putting a top level filter (basically like below) but that just
filtered my query result and didn't apply for suggestions.
Any thoughts on how I can add a filter to the suggest request?
{
"query": {
"query_string": {
"query": "........",
"default_operator": "and"
}
},
"filter": {
"term": {
"...........": "..........."
}
},
"explain": true,
"suggest": {
"myTermSuggestionBuilder": {
"text": "...............",
"term": {
"field": "................",
"size": 5,
"suggest_mode": "always",
"min_word_len": 3
}
},
"myPhraseSuggestionBuilder": {
"text": "...........",
"phrase": {
"field": "..................",
"size": 5,
"max_errors": 0.5,
"gram_size": 3,
"direct_generator": [
{
"field": "...................",
"suggest_mode": "always",
"min_word_len": 3
}
]
}
}
}
}
Amit
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.