lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
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.


--
Ian.


On Wed, Jul 20, 2011 at 9:14 AM, bryant88 <raf.bran@gmail.com> 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: http://lucene.472066.n3.nabble.com/use-of-FieldInvertState-class-tp3182214p3184835.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message