I've tried a dozen variations to get this to work, so clearly there is
something I don't understand.
I'm trying to dynamically create a field on an object with both an analyzed
version of the field and a non-analyzed one so that the faceted results can
return individual terms or the whole field.
eg. meta.byline : "Greg Brown" and meta_raw.byline : "Greg Brown"; Result
of the meta_raw.byline facet should be "Greg Brown" while meta.byline
should have two terms: "greg" and "brown"
Maybe I'm not using the path_match on the dynamic template correctly? Also,
I feel like the '"index" : "not_analyzed"' on the meta_raw object mapping
should get inherited by sub-fields, but that doesn't seem to be what
happens.
Bonus points for a way to use the multi_field type mapping to make
meta.byline and meta.byline.raw work. I decided to just try and get the
simple solution to work first.
Figured out my own problem. Defining the meta and meta_raw fields as
objects seemed to override the dynamic template. Not sure if this is
intended behavior.
I've tried a dozen variations to get this to work, so clearly there is
something I don't understand.
I'm trying to dynamically create a field on an object with both an
analyzed version of the field and a non-analyzed one so that the faceted
results can return individual terms or the whole field.
eg. meta.byline : "Greg Brown" and meta_raw.byline : "Greg Brown"; Result
of the meta_raw.byline facet should be "Greg Brown" while meta.byline
should have two terms: "greg" and "brown"
Maybe I'm not using the path_match on the dynamic template correctly?
Also, I feel like the '"index" : "not_analyzed"' on the meta_raw object
mapping should get inherited by sub-fields, but that doesn't seem to be
what happens.
Bonus points for a way to use the multi_field type mapping to make
meta.byline and meta.byline.raw work. I decided to just try and get the
simple solution to work first.
I haven't had any success using the "path_match" option either. Instead, I
use the "match" option which works fine which matches only on the field
name and not on the path. If that isn't strict enough, then I define each
object's mapping explicitly. To fix your dynamic_templates section for the
multi_field,
change
"path_match" : "meta."
to
"match" : "byline"
On Wednesday, September 5, 2012 3:00:55 PM UTC-5, Greg Brown wrote:
Figured out my own problem. Defining the meta and meta_raw fields as
objects seemed to override the dynamic template. Not sure if this is
intended behavior.
On Wed, Sep 5, 2012 at 11:42 AM, Greg Brown <gbrow...@gmail.com<javascript:>
wrote:
I've tried a dozen variations to get this to work, so clearly there is
something I don't understand.
I'm trying to dynamically create a field on an object with both an
analyzed version of the field and a non-analyzed one so that the faceted
results can return individual terms or the whole field.
eg. meta.byline : "Greg Brown" and meta_raw.byline : "Greg Brown"; Result
of the meta_raw.byline facet should be "Greg Brown" while meta.byline
should have two terms: "greg" and "brown"
Maybe I'm not using the path_match on the dynamic template correctly?
Also, I feel like the '"index" : "not_analyzed"' on the meta_raw object
mapping should get inherited by sub-fields, but that doesn't seem to be
what happens.
Bonus points for a way to use the multi_field type mapping to make
meta.byline and meta.byline.raw work. I decided to just try and get the
simple solution to work first.
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.