Int Array INTERSECT filter - performance boosting?

(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!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.