Redundant should block or query_string in query?

hey there,
I can get the same result using two different approach for a specific query.
The first one uses several should terms

"should": [
            {
              "terms": {
                   "fieldname": ["value1"]
               }
              },
               ...
               ...
               ... 
               {
               "terms": {
                   "fieldname": ["valueX"]
               }
              }
            ],
             "minimum_should_match": "80%"

while the second one will use the block:

{
      "query_string" : {
         "default_field" : "fieldname",
         "query" : "value1 OR value2 ......OR valueX",
         "minimum_should_match": "80%"
         }
 }

is there any suggestion to use one of them and to avoid any load or to increase speed?
I don't know exactly how should directive works so I don't if it will query my index for every block or just one time.
Currently, the first scenario is in place and queries are taking more or less 500ms. Achieving a time reduction even just 100ms could be important but I have not a chance to reproduce the same load in the second scenario so I have to start from the theory.

Is there anyone that can try to address me?

Internally those will likely be rewritten to similar queries, so I would use the one I feel more comfortable with. You can use the explain field to compare the two queries with each other.

Hope that helps!

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