Hi all,
we're currently relying on elasticsearch named queries support for calculating a custom heuristic, for every result hit: given N "should" queries in a bool query, which query is every hit related to?
For example, querying looks like this:
"bool" : {
"should" : [
{
"bool" : {
/* ... */,
"_name" : "query one"
}
},
{
"bool" : {
/* ... */,
"_name" : "query two"
}
},
{
"bool" : {
/* ... */,
"_name" : "query three"
}
}
]
}
For every hit result we extract the matched_queries array field: the bigger the array is, the more "trustable" the result is.
Except for one weird behaviour on corner cases, we'ore ok with this approach, from a functional point of view. But we're facing non-functional problems, in term of one order of magnituted increase in query time, compared with named queries disabled: 300 ms when enabled compared with 30 ms when disabled. Is this the expected behaviour?
Is this something related to the elasticsearch version? We're currenlty using version 1.7 (for simpler compatibility with client connectors). Should we expect better performances, in the context of named queries, simply ugrading to 2.x version?
Thanks for the support.