Increase query performance for many OR clauses

Thank you for your response :slight_smile:. I have couple questions.

1- Since all the clauses are OR, how does elasticsearch process them? Does it do it one by one or create a matrix of all the terms idf and does cosine similarity on each document?

2- "You could also try to do some boolean minimization to make sure the queries aren't looking for the same terms. Can you please explain more on this?" So after the query string gets analyze and breaks down to terms, elasticsearch doesn't eliminate the duplicate terms?

3- We actually try to increase the number of nodes (machine) which did not helps us at all. Currently We have 3 data nodes and one client node. Each data node has 1 shard. Each node or VM has 16 VCPU with 46 GB of RAM. The total number of documents are 366136 and each shard has about 450 MB of data. Should we increase the number of shards per node? After I read some article I found out that the more shards on the same node (machine) can increase the overhead. What is your recommendation?

4- Is it a good idea to break down the query to smaller portions (let's say 4) and make a query in 4 diff threads and then combine the result? I am guessing the elasticsearch might do that internally.

Thank you