0

I have 4 documents in elasticsearch. Below is how it looks like

enter image description here

I am trying to query document only where word Python is mentioned in the title. I am using head plugin and below is the GET command i am passing.

enter image description here

However, instead of getting the document where Python is mentioned, i am getting all documents.

{
"took": 8,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 1,
"hits": [
{
"_index": "library",
"_type": "book",
"_id": "2",
"_score": 1,
"_source": {
"title": "Building machine learning systems in JAVA",
"publish_date": "July 2014",
"price": 59.9
}
}
,
{
"_index": "library",
"_type": "book",
"_id": "4",
"_score": 1,
"_source": {
"title": "Building machine learning systems in C++",
"publish_date": "July 2016",
"price": 79.9
}
}
,
{
"_index": "library",
"_type": "book",
"_id": "1",
"_score": 1,
"_source": {
"title": "Building machine learning systems in Python",
"publish_date": "July 2013",
"price": 49.9
}
}
,
{
"_index": "library",
"_type": "book",
"_id": "3",
"_score": 1,
"_source": {
"title": "Building machine learning systems in SCALA",
"publish_date": "July 2015",
"price": 69.9
}
}
]
}
}

Not sure what i am missing

StatguyUser
  • 2,595
  • 2
  • 22
  • 45
  • 1
    This answer might help: https://stackoverflow.com/questions/34795053/es-keeps-returning-every-document/34796014#34796014 – Val Oct 29 '17 at 09:24

1 Answers1

1

It's probably caused by the tool you are using to send the request. GET with body is not supported often. Use POST instead.

dadoonet
  • 14,109
  • 3
  • 42
  • 49