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 Tan Weijian <we...@brandtology.com> on 2011/08/05 03:13:37 UTC

Query Hits

Hi ,

I am currently using lucene 2.4, is there a way to count how many words from my query hits the post?

Lets say my query is:
APPLE OR BANANA OR ORANGE


The post is:
I have a banana, i love to eat banana and apple

This case, banana keyword is hit twice and apple is hit once, is there a way to get the count?


Thanks!

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


Re: Query Hits

Posted by Ian Lea <ia...@gmail.com>.
> I am currently using lucene 2.4,

Time to upgrade?

> is there a way to count how many words from my query hits the post?
>
> Lets say my query is:
> APPLE OR BANANA OR ORANGE
>
>
> The post is:
> I have a banana, i love to eat banana and apple
>
> This case, banana keyword is hit twice and apple is hit once, is there a way to get the count?

I don't think there is an easy way, but the highlighting stuff might
be relevant.


--
Ian.

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