tags:

views:

40

answers:

1

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 is 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.?

+1  A: 

Assuming your ID is a numeric field, then have a look at the "longToPrefixCoded" function in the "NumericUtils" namespace.

Hope this helps,

Moleski