Multi-String search not working as expeced

While executing following query,

GET /rm_inventory_details*/_search
{
    "query": {
      "query_string": {
        "default_field": "usage",
        "query": "(XYZ)"
      }
	}
}

Getting result.
again

GET /rm_inventory_details*/_search
{
    "query": {
      "query_string": {
        "default_field": "usage",
        "query": "(ABC)"
      }
	}
}

Also getting result.

But while using following I am only getting second choice while expecting both the string either or.

GET /rm_inventory_details*/_search
{
    "query": {
      "query_string": {
        "default_field": "usage",
        "query": "(XYZ) OR (ABC)"
      }
	}
}

Why the parenthesis?
Could you share all responses?

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Hi,

Result is same even if I use parenthesis or not.
It is taking second value not the first one but surely both values are present in index field "usage".
I can see both if I use

"query": "XYZ"

or

"query": "ABC"

individually.

I would only like to know what wrong I am doing here.

by the way I am using 7.1.1.

Output is quite large to fit. If you still insist then I need to create a less numbered data ant try.

Would be great.

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