The equivalent query method to search documents by explicit type, as if specified in the URL (like in ES < 6.x)

(juiip) #1

In Elasticsearch < 6.x, you would search through documents of a specific type within the query url like so:
GET index_name/type_name/_search

However, in Elasticsearch 6.x, with the removal of multiple mapping types, the url can only be:
GET index_name/_doc/_search

I have instead specified the type of the document explicitly like so:
"type": "publisher"

There are numerous ways to retrieve documents by specifying what term you want to select, such as filter, match, must... but I don't know which is the equivalent of specifying the type in the url?

(Mark Walkom) #2


Is just a field to Elasticsearch, so use a filter in the query and you should be good.

(system) #3

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