Lucene : IndexWriter.update - how to form term for searching numeric values
My index has the following fields : ID (type long, indexed, stored, not analyzed), Contents (String, not indexed, not analyzed, stored) and Tags (String, indexed, analyzed, stored).
Need to update the Contents for a given ID - how to do that using IndexWriter.update? How do I form the term?
If the ID i开发者_如何转开发s stored as String I can form the Term as new Term(ID, "someID") - but will that have any other impact regarding long/String conversions etc.?
Assuming your ID is a numeric field, then have a look at the "longToPrefixCoded" function in the "NumericUtils" namespace.
Hope this helps,
精彩评论