Slowly term queries

Hi,

I’m using scan function in Python to retrieve more than 10000 results
There are only filter queries
I search only for terms
There is no aggregation, only simple term queries
I executed two queries with the same structure
both of them return 20 documents but in different timing
Both of them run on the same specific shard
Because of the routing (not in the same time)
But the search performance in one are much better than the second
The difference between them is one term field

What could make the difference

Query 1

”blabla”:”4”
“gg”:”67”

Query 2

”blabla”:”4”
“kk”:”89”

Thanks,
Liron

I am not familiar with scan function. How do these query look in Elasticsearch DSL? Is 10000 a size parameter? Are these AND queries?

Hi,

thanks for answering

something like that
just with must clause inside the filter clause
image

but scan is not the problem because one query run fast and the second run very slowly
the difference is just one term in the filter

size is 1000

only AND queries because I'm using must clause
I specify only 2 terms in must clause

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