I am seeing inconsistent behavior in ES 0.90.7 when storing a string
directly in a multi_field, versus as a hash of attributes. Relevant gists:
The only difference in the above two gists is the JSON document published
to ES. In the former, the string is directly associated with its value:
"name" : "test me"
In the latter, the string is associated with a hash which contains its
value:
The mapping is required to disambiguate the meaning of the document.
Otherwise, the structure would interpret "message" as a value of type
"object". The key _value (or value) in the inner document specifies the
real string content that should eventually be indexed. The _boost (or boost)
key specifies the per field document boost (here 2.0).
The culprit looks to be MultiFieldMapper.parse. In theory, the code should
rewind the ParserContext to the START_OBJECT token before calling
Mapper.parse. As it is, the second and later Mapper objects receive a
ParserContext stuck at the END_OBJECT token, as the first mapper has
consumed additional tokens.
Is there a simple way to mark and reset XContentParser, similar to an
InputStream?
On Sunday, December 1, 2013 11:55:49 PM UTC-8, zellster wrote:
I am seeing inconsistent behavior in ES 0.90.7 when storing a string
directly in a multi_field, versus as a hash of attributes. Relevant gists:
The only difference in the above two gists is the JSON document published
to ES. In the former, the string is directly associated with its value:
"name" : "test me"
In the latter, the string is associated with a hash which contains its
value:
The mapping is required to disambiguate the meaning of the document.
Otherwise, the structure would interpret "message" as a value of type
"object". The key _value (or value) in the inner document specifies the
real string content that should eventually be indexed. The _boost (or
boost) key specifies the per field document boost (here 2.0).
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.