I'm trying to query an elastic search cluster.
The index name is titles
and _type is title
. When I put the type in the request URL, the filtering works as expected:
POST http://esendpoint.com/titles/title/_search?
The body:
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{ "term" : {"_docTitleIds" : "65d-7ab2-41d4-a928-300accfc8ab7"}}
]
}
}
}
}
However if I add the _type title in the query body, and not in the URL I get all results under the index titles
. But when used in the URL, I get results only from the type title
POST http://esendpoint.com/titles/_search
The body:
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{ "term" : {"_type" : "title"}},
{ "term" : {"_docTitleIds" : "65d-7ab2-41d4-a928-300accfc8ab7"}}
]
}
}
}
}
I'm not able to follow why this is happening.