FAQ
I am doing a search using Lucene, and when I get the search results (hits),
I want to be able to get the number of tokens in a certain field.

Is this possible? Where is this sort of information stored?

I know the IndexSearcher.Explain can get some information, but it seems
mostly in free text and I cannot see the numTokens value.

Ideally what I would like to be able to do is get the NumTokens value and
the amount of hits within a field and display to the user what the "keyword
density" is as a percentage.

Any pointers would be greatly appreciated.

Thanks,

Andrew

Search Discussions

  • Chris Hostetter at Oct 21, 2008 at 11:12 pm
    : I want to be able to get the number of tokens in a certain field.
    :
    : Is this possible? Where is this sort of information stored?

    generally this info isn't actually recorded in the index -- it's used to
    compute a fieldNorm, and that is recorded.

    You might be able to get this by turning on TermVectors, but that's not a
    feature i've played with so i'm not sure off hte top of my head how you
    would do it.


    -Hoss


    ---------------------------------------------------------------------
    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
postedOct 13, '08 at 12:03p
activeOct 21, '08 at 11:12p
posts2
users2
websitelucene.apache.org

2 users in discussion

Andrew Rimmer: 1 post Chris Hostetter: 1 post

People

Translate

site design / logo © 2022 Grokbase