MoonHorse
MoonHorse

Reputation: 2489

Match query doesn't return the result

i am new to ES. I am using the ES 7.2 and i am making this query from Kibana. I write the below query to get all the documents who has "11" in field STATUS.

GET /index1/_search

{
  "query":{
    "match" : {
        "STATUS":"11"
    }
  }
}

But the result includes as well the documents with STATUS other than 11. What do i do wrong? I want that the query returns just the docs with STATUS 11.

Upvotes: 1

Views: 100

Answers (1)

Kevin Quinzel
Kevin Quinzel

Reputation: 1428

Try not to let more than one space between the GET /in... and your query.

Instead of:

GET ...

{
   your query
}

Do this:

GET ...
{
   your query
}

If you run it like you have it now, it only will run the GET petition, which is like you were telling it "Bring me everything".

Hope this is helpful! :D

Upvotes: 2

Related Questions