Elasticsearch Bool Query Issue

Im unable to query elasticsearch documents for the below scenario.

For Ex:

I will query ES with combination of ID and Val. So if both matches it should return the matched documents, if not it should return only ID matched documents but I'm unable to do with the bool query

Please help me to solve this problem.


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 will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

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