Hey, i want to query on a specific field with 1000 clauses separated by OR. But the latencies that i am getting are very high. Is there any setting in elastic to set cache policy for values of a field so that the values for a field are always stored in memory and queries on that field even with 1000 OR clauses are optimised.
Also is there any other special type of search query provided by elastic to achieve this?
So i am currently using terms query on a specific field to do this. It contains almost 1000 words. However the latencies which i am getting are more than 5 seconds whereas for another basic search query i get search latencies of miliseconds.
"test_field": [ "random_1", "random_2"....."random_1000" ],
Is there any way where we can keep the values for this test_field in memory which results in quicker retrieval and improvement in latencies.
Also suggest other ways to improve on the term queries.
Hmm, this query is fairly simple in nature, I don't know if there is much from an optimization perspective. I'd try to run this through the profile API to see what is taking the time here. The only thing that I think might save some compute time, is if you don't need scoring, you could probably wrap the terms query in a bool/filter to not have the documents scored.
Others here might have more ideas, but I think running through the profile API would be a good start in trying to find the issue.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.