I usually handle this behavior on the indexing side, outside of
Elasticsearch. Related fields use the same field name.
Do you need the _all field in general? If you don't, you can
set include_in_all to false for every field except the link fields. If not,
there is an index_name setting in the mapping that I have never used. From
the description, it sounds like it should support what you are looking for.
Multi-field would not work since they are based off of the original field.
Besides using the _all field and index_name attribute as Ivan suggested,
you can also use mutli_match query to search multiple fields at the same
time:
On Friday, January 4, 2013 12:29:00 PM UTC-5, Ivan Brusic wrote:
I usually handle this behavior on the indexing side, outside of
Elasticsearch. Related fields use the same field name.
Do you need the _all field in general? If you don't, you can
set include_in_all to false for every field except the link fields. If not,
there is an index_name setting in the mapping that I have never used. From
the description, it sounds like it should support what you are looking for.
Multi-field would not work since they are based off of the original field.
Using multi_field to copy relevant fields into a single field is what's
best I think.
With multi_match or a boolean query there'd be a problem: All possible
fields are not easily known at query time and the list can be large.
For that reason I'll choose the optimization of having a single compound
field at indexing time.
Thank you both for your help!
Stephan
On Monday, January 7, 2013 2:30:13 AM UTC+1, Igor Motov wrote:
Besides using the _all field and index_name attribute as Ivan suggested,
you can also use mutli_match query to search multiple fields at the same
time:
On Friday, January 4, 2013 12:29:00 PM UTC-5, Ivan Brusic wrote:
I usually handle this behavior on the indexing side, outside of
Elasticsearch. Related fields use the same field name.
Do you need the _all field in general? If you don't, you can
set include_in_all to false for every field except the link fields. If not,
there is an index_name setting in the mapping that I have never used. From
the description, it sounds like it should support what you are looking for.
Multi-field would not work since they are based off of the original field.
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.