I'm trying to build a query that will return all documents where field1
from index1 equals field2 from index2. A query_string representation of
this might be "human.first_name := animal.nick_name". I've read up on
script filters but can't seem to get them to work -- all I can manage is a
bunch of exceptions
For example, suppose my document structure for a "people" index resembles
the following:
Hi,
the problem here is that scripts are supposed to be executed on a single
document. That's what the doc variable is in a script: the current
document. You can't compare different documents from a script. Also, it
seems like you are trying to do some kind of cross-index join, which is not
the best thing to do with elasticsearch
On Monday, September 9, 2013 11:31:44 PM UTC+2, Jamil Bou Kheir wrote:
Hi all,
I'm trying to build a query that will return all documents where field1
from index1 equals field2 from index2. A query_string representation of
this might be "human.first_name := animal.nick_name". I've read up on
script filters but can't seem to get them to work -- all I can manage is a
bunch of exceptions
For example, suppose my document structure for a "people" index resembles
the following:
Thanks for your response. I was afraid of that :-(.
The problem is that the user will be specifying the fields to correlate, so
the documents need to be "joined" at query time based on the specified
field to match on... e.g. many-to-many relationship. Probably a job more
suited to a relational database, but perhaps ES will offer some basic
cross-document correlation / comparison features in the near future. I'm
more than willing to take the performance hit :-).
For now, I'll have to script my app to allow the user to perform recursive
queries.
Jamil
On Monday, September 9, 2013 9:05:15 PM UTC-7, Luca Cavanna wrote:
Hi,
the problem here is that scripts are supposed to be executed on a single
document. That's what the doc variable is in a script: the current
document. You can't compare different documents from a script. Also, it
seems like you are trying to do some kind of cross-index join, which is not
the best thing to do with elasticsearch
On Monday, September 9, 2013 11:31:44 PM UTC+2, Jamil Bou Kheir wrote:
Hi all,
I'm trying to build a query that will return all documents where field1
from index1 equals field2 from index2. A query_string representation of
this might be "human.first_name := animal.nick_name". I've read up on
script filters but can't seem to get them to work -- all I can manage is a
bunch of exceptions
For example, suppose my document structure for a "people" index resembles
the following:
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.