(The question is somewhat related to Array intersect filter?)
Given an array of integers on each document in ESDB I want to pull only documents that have any of the query input values - so it's basically INTERSECT/CONTAINS query.
My question is: can the index be optimized for this sort of INTERSECT search? Any analyzer tuning? Or maybe changing ordering of the values?
Perhaps there's a more efficient way to query? This is the way I filter at the moment:
"query": {
"filtered": {
"filter": {
"bool": {
"should": [
{
"terms": {
"array_of_ints_field": [
1,
2,
3,
4
]
}
}
]
}
}
}
}
Many thanks in advance!