You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Raffaele Branda <ra...@gmail.com> on 2011/07/19 13:30:00 UTC
use of FieldInvertState class
Dear Lucene developers,
I am a student from an University in Italy and I am using Lucene for a
project.
I need to use the *FieldInvertState* class in order to get all the values of
a given field state at indexing time. Is there a method that returns a *
FieldInvertState* object? Is there any tutorial on how to use it?
Thanks.
Best regards.
Raffaele Branda.
Re: use of FieldInvertState class
Posted by bryant88 <ra...@gmail.com>.
Ok thanks,
maybe i understood. I will try to store the field length in a Map in my
custom Similarity and then pick them with
a getLength() method and then divide it by the number of docs so i can have
the average length of a field.
thank you
Raffaele Branda
--
View this message in context: http://lucene.472066.n3.nabble.com/use-of-FieldInvertState-class-tp3182214p3184991.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
Re: use of FieldInvertState class
Posted by Ian Lea <ia...@gmail.com>.
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 <ra...@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
Re: use of FieldInvertState class
Posted by bryant88 <ra...@gmail.com>.
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
Re: use of FieldInvertState class
Posted by Robert Muir <rc...@gmail.com>.
On Tue, Jul 19, 2011 at 7:30 AM, Raffaele Branda <ra...@gmail.com> wrote:
> Dear Lucene developers,
>
> I am a student from an University in Italy and I am using Lucene for a
> project.
>
> I need to use the *FieldInvertState* class in order to get all the values of
> a given field state at indexing time. Is there a method that returns a *
> FieldInvertState* object? Is there any tutorial on how to use it?
>
Can you describe in more detail (high-level) what you are trying to do?
The most common hook here for customization where FieldInvertState is
exposed is in Similarity's computeNorm,
--
lucidimagination.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org