Matching query issue, fetching results even fields are not matching

Hello ,

i have array json file loaded a document in index , and i am trying to run a match query on that, results are fetching if the field parameter are wrong.
, , ,
' {
} '
, , ,

This is my document format that i have loaded into index.

here index name : jsonfile , type name is _doc , id = 1

i am writing a match query based on matching fields as like below

, , ,
GET http://localhost:9200/jsonfile/_search
            '    {
                  "query": {
                "bool": {
                      "name": "B"
                      "match": {
                        "phone": **"P"**
                    ]}}} '

, , ,

but i am getting results if i am passing wrong parameter to matching fileds

Any suggestions please , help with the query

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:


This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

Here it sounds like it does not match on phone: P as the user has phone: N.

If you can't fix it by yourself, I recommend 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.

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