I have a custom scorer plugin that needs access to the document's _id field
(not the Lucene docId). At the moment, the following always returns null:
doc().field("_id")
I have tried playing with the mapping and setting "store" to true/false,
different "index" values, etc., but to no avail. At the moment, the only
thing that works, but is horribly ugly is to parse the _uid field and split
on the "#" since the field is of the form "<_type>#<_id>".
Could it be that it is not stored?
"By default it is not indexed and not stored (thus, not created) ... the
APIs still work (since they work with the |_uid| field)"
On 9/5/2012 5:28 AM, joshdevins wrote:
I have a custom scorer plugin that needs access to the document's _id
field (not the Lucene docId). At the moment, the following always
returns null:
doc().field("_id")
I have tried playing with the mapping and setting "store" to
true/false, different "index" values, etc., but to no avail. At the
moment, the only thing that works, but is horribly ugly is to parse
the _uid field and split on the "#" since the field is of the form
"<_type>#<_id>".
I have a custom scorer plugin that needs access to the document's _id
field (not the Lucene docId). At the moment, the following always
returns null:
doc().field("_id")
I have tried playing with the mapping and setting "store" to
true/false, different "index" values, etc., but to no avail. At the
moment, the only thing that works, but is horribly ugly is to parse
the _uid field and split on the "#" since the field is of the form
"<_type>#<_id>".
I have a custom scorer plugin that needs access to the document's _id
field (not the Lucene docId). At the moment, the following always
returns null:
doc().field("_id")
I have tried playing with the mapping and setting "store" to
true/false, different "index" values, etc., but to no avail. At the
moment, the only thing that works, but is horribly ugly is to parse
the _uid field and split on the "#" since the field is of the form
"<_type>#<_id>".
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.