StatguyUser
StatguyUser

Reputation: 2665

Elasticsearch match query not working

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

Upvotes: 0

Views: 587

Answers (1)

dadoonet
dadoonet

Reputation: 14492

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

Upvotes: 1

Related Questions