I have 2 indices. The first is my committed index, the second is a
'working' index. Some of the documents in the working index could be
updates to documents that already exist in the committed index (a
particular document will have the same "_id" in both indices).
When the user performs a search I want to search both indices and then
combine the results such that if a document exists in both the working
and committed index only the working one is returned.
Is this possible in a single search without requiring any post-
processing? I'd like to avoid the post-processing to avoid headaches
with pagination. I'm a newb at ES so am just learning how to apply the
various things.
I have 2 indices. The first is my committed index, the second is a
'working' index. Some of the documents in the working index could be
updates to documents that already exist in the committed index (a
particular document will have the same "_id" in both indices).
When the user performs a search I want to search both indices and then
combine the results such that if a document exists in both the working
and committed index only the working one is returned.
Is this possible in a single search without requiring any post-
processing? I'd like to avoid the post-processing to avoid headaches
with pagination. I'm a newb at ES so am just learning how to apply the
various things.
To answer the original question, its not possible to say override results from one index to another. When searching on two indices (as Peter suggested), it will simply return the results from both indices, and you will get "duplicates". You do get the index the result came from back, so possibly you can filter duplicates out.
On Friday, April 1, 2011 at 12:18 AM, Karussell wrote:
I'm not sure if this only applies to shards or to different indices
too. But try this:
I have 2 indices. The first is my committed index, the second is a
'working' index. Some of the documents in the working index could be
updates to documents that already exist in the committed index (a
particular document will have the same "_id" in both indices).
When the user performs a search I want to search both indices and then
combine the results such that if a document exists in both the working
and committed index only the working one is returned.
Is this possible in a single search without requiring any post-
processing? I'd like to avoid the post-processing to avoid headaches
with pagination. I'm a newb at ES so am just learning how to apply the
various things.
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.