1

What is the exact difference between Query String and Simple Query String? The only difference that is mentioned in the docs is that Query String is more advanced but throws an exception when a sent query cannot be parsed.

However, I've noticed that Query String behave differently even if there isn't any exception in the query string.

Here are two same queries but the one with query string returns a response and the simple query string returns zero documents. I want to know what is going on behind the curtain.

{ 
 "query": {
    "bool": {
       "must": [
        {
           "query_string": {
           "query": "Atoms for Peace",
           "default_operator": "AND"
      
        }
      }
    ]
  }
 }
}
{ 
"query": {
  "bool": {
    "must": [
      {
        "simple_query_string": {
          "query": "Atoms for Peace",
          "default_operator": "AND"
        }
      }
    ]

  }
}
}


1 Answer 1

0

You can include explain=true query param in your search endpoint, this will give you detailed response on what tokens are created for your search terms and why your results are different in both the queries.

Sign up to request clarification or add additional context in comments.

4 Comments

The computation with both queries looks fairly similar. The same formulas are being used for the frequency of occurrence, IDF, and boost. I'm really confused about what is causing different results.
@sheharbano can you share index mapping,. sample documents
No, the problem hasn't been solved yet. Here's the document that I'm trying to search api.vam.ac.uk/v2/museumobject/O696516
@sheharbano its really big document, can you provide a smaller document to showcase your issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.