Counting occurrence of text on a lucene index

View: New views
2 Messages — Rating Filter:   Alert me  

Counting occurrence of text on a lucene index

by aionius :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good day to all.

I'm trying Lucene and so far I've managed to create an index, query and get the result.
I just have some few questions. How can I get the number of occurrences of the query string
on my index? For example, I'm searching for the word "hyperspace" on my indices, Lucene
found it on pages 5, 6, and 8. Now I want to know how many times the word "hyperspace"
was found on each of those pages.

Is this possible in Lucene?

Any help would be appreciated.


Re: Counting occurrence of text on a lucene index

by Simon Willnauer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

See IndexReader#docFreq(Term)
Btw. You should ask those questions on the java-users list

Simon

On Nov 6, 2009 1:35 PM, "aionius" <aionius@...> wrote:


Good day to all.

I'm trying Lucene and so far I've managed to create an index, query and get
the result.
I just have some few questions. How can I get the number of occurrences of
the query string
on my index? For example, I'm searching for the word "hyperspace" on my
indices, Lucene
found it on pages 5, 6, and 8. Now I want to know how many times the word
"hyperspace"
was found on each of those pages.

Is this possible in Lucene?

Any help would be appreciated.


--
View this message in context: http://old.nabble.com/Counting-occurrence-of-text-on-a-lucene-index-tp26230903p26230903.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@...
For additional commands, e-mail: java-dev-help@...