Is it possible to issue distinct queries to multiple types within the
same index? I have a few types with different mappings (some overlap)
and I need to query some of the fields of each with the same query
string, but the queries are inherently different because of the
mappings. It seems like it is only possible to execute the same query
against multiple types. If that is the case, how would you guys feel
about extending the API to support multiple distinct queries?
Here is a gist with the current queries and below that is a rough idea
of how the multiple queries could work.
That is probably is fine query, but it would give me all the results
mixed and scored together. I need to them to be separated based on
the type in the results.
Thanks for the reply, Shay. Is that something you think is reasonable
to implement in ES as opposed to in the client? I would picture it
being similar to the bulk indexing/delete API but with queries, as
demonstrated in the gist I posted.
Effectively what you are after is "multi search" API, its definitely possible, but not high on the list (at least for now…) since you can execute several search requests, and its less acute compared to multi get / batch indexing.
On Tuesday, January 24, 2012 at 2:01 AM, qjh wrote:
Is it possible to issue distinct queries to multiple types within the
same index? I have a few types with different mappings (some overlap)
and I need to query some of the fields of each with the same query
string, but the queries are inherently different because of the
mappings. It seems like it is only possible to execute the same query
against multiple types. If that is the case, how would you guys feel
about extending the API to support multiple distinct queries?
Here is a gist with the current queries and below that is a rough idea
of how the multiple queries could work.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.