lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <>
Subject Re: use of FieldInvertState class
Date Wed, 20 Jul 2011 09:14:11 GMT
FieldInvertState is passed to Similarity.computeNorm, as Robert said.
So your custom Similarity just has to override computeNorm(String
field, FieldInvertState state) and can extract whatever it wants from
the FieldInvertState passed in.


On Wed, Jul 20, 2011 at 9:14 AM, bryant88 <> wrote:
> Ok. I need to use this class to get length of a given field at index time to
> pass it as parameter to the computeNorm method from a custom Similarity.
> The issue is that i don't know how to get a FieldInvertState object and
> precisely i didn't understand if I have to create and populate it myself or
> there is a method that, passed a field name (or something like
> myField.getFieldInvertState() ), returns a FieldInvertState object with all
> its parameters (i.e. position,length, numOverlap, offset and boost) already
> populated.
> --
> View this message in context:
> Sent from the Lucene - Java Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message