What are the allowed characters in field names? Specifically, are
hyphens allowed in field names? I currently have a term facet that has
a 'script' attribute being "term + 'aaa' + _source.foo-bar" and I am
getting the following exception: Query Failed [Failed to execute main
query]]; nested: PropertyAccessException[[Error: could not access:
[bar; in class: org.elasticsearch.search.lookup.SourceLookup]
Based on this exception, it seems that ES is treating the hyphen as a
delimiter between 2 fields?
If hyphens are not allowed in field names, is there definitive
documentation on what characters (ideally in a regex if there are also
rules about acceptable first characters, etc...) are allowed in field
names?
What are the allowed characters in field names? Specifically, are
hyphens allowed in field names? I currently have a term facet that has
a 'script' attribute being "term + 'aaa' + _source.foo-bar" and I am
getting the following exception: Query Failed [Failed to execute main
query]]; nested: PropertyAccessException[[Error: could not access:
[bar; in class: org.elasticsearch.search.lookup.SourceLookup]
Based on this exception, it seems that ES is treating the hyphen as a
delimiter between 2 fields?
If hyphens are not allowed in field names, is there definitive
documentation on what characters (ideally in a regex if there are also
rules about acceptable first characters, etc...) are allowed in field
names?
There isn't really a limit on what can be in a field name. In your case, the
script is actually a script (by default, mvel). Since _source is actually
treated as a Map lookup, you can do _source['foo-bar'].
What are the allowed characters in field names? Specifically, are
hyphens allowed in field names? I currently have a term facet that has
a 'script' attribute being "term + 'aaa' + _source.foo-bar" and I am
getting the following exception: Query Failed [Failed to execute main
query]]; nested: PropertyAccessException[[Error: could not access:
[bar; in class: org.elasticsearch.search.lookup.SourceLookup]
Based on this exception, it seems that ES is treating the hyphen as a
delimiter between 2 fields?
If hyphens are not allowed in field names, is there definitive
documentation on what characters (ideally in a regex if there are also
rules about acceptable first characters, etc...) are allowed in field
names?
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.