To use percolator in ElasticSearch, I need to index search queries. However, we mainly use filters for search. To index these filters, they must be wrapped in a query .
I know two different approaches to this. Wrap the filter in the filtered query :
{
"query": {
"filtered": {
"filter": { ... }
}
}
}
or using the query for the score constant :
{
"query": {
"constant_score": {
"filter": { ... }
}
}
}
Which method is preferred? Why?
Jippe source
share