I came across this post but that does not seem to help.
I have the following ES mapping:
properties {
message {
type: text
analyzer: standard
norms: false
}
additional {
type: object
dynamic: strict
properties {
sub {
type: object
properties {
message : {
type: text
analyzer: standard
index: false
copy_to: message
}
}
}
}
}
}
I am able to search through the message field and I get hits as expected if what I am looking for is in the additional.sub.message field. However, highlighting is always empty if what matches is in the additional field. The only way to make it work is to put store:true but for cost reason I would not want to set it. Is there any other way to have this working?
But message is part of _source which is stored.
You can compute at index time message field and modify the source document before you send it to the index API. So it will be stored within _source.
I don't think so.
That being said I'm not sure I got the initial concern and what kind of problem you are trying to solve with copy_to here.
May be provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
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.