If I initially search my db and get back 3 documents.
Doc 1:
field_a : user1_id
Doc 2:
field_a : user1_id
Doc 3:
field_a : user2_id
I then want to search using the value 'user2_id'
Currently I achieve this with a search that gives me the 3 docs, take the
value 'user2_id' and research with a must not filter. Which is adequate but
I feel like I have all the information to do it in one.
On Thu, 2013-03-21 at 07:04 -0700, Teddy777 wrote:
If I initially search my db and get back 3 documents.
Doc 1:
field_a : user1_id
Doc 2:
field_a : user1_id
Doc 3:
field_a : user2_id
I then want to search using the value 'user2_id'
Currently I achieve this with a search that gives me the 3 docs, take
the value 'user2_id' and research with a must not filter. Which is
adequate but I feel like I have all the information to do it in one.
Essentially you are wanting to do a join. Elasticsearch doesn't support
joins per se. You could look at using parent/child, which is a form of
join, but it may come with more complexity than you need.
Doing the above in two queries is probably the best way of achieving
what you need
HI, yeah ok thanks for that.
On Thursday, 21 March 2013 14:04:23 UTC, Teddy777 wrote:
If I initially search my db and get back 3 documents.
Doc 1:
field_a : user1_id
Doc 2:
field_a : user1_id
Doc 3:
field_a : user2_id
I then want to search using the value 'user2_id'
Currently I achieve this with a search that gives me the 3 docs, take the
value 'user2_id' and research with a must not filter. Which is adequate but
I feel like I have all the information to do it in one.
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.