FAQ
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.

Search Discussions

  • Robert Muir at Jul 19, 2011 at 12:33 pm

    On Tue, Jul 19, 2011 at 7:30 AM, Raffaele Branda 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
  • Bryant88 at Jul 20, 2011 at 8:15 am
    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
  • Ian Lea at Jul 20, 2011 at 9:15 am
    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 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
  • Bryant88 at Jul 20, 2011 at 9:31 am
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJul 19, '11 at 11:45a
activeJul 20, '11 at 9:31a
posts5
users3
websitelucene.apache.org

3 users in discussion

Bryant88: 3 posts Robert Muir: 1 post Ian Lea: 1 post

People

Translate

site design / logo © 2022 Grokbase