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 Vaijanath Rao <va...@gmail.com> on 2010/01/28 17:17:48 UTC

How to get matched terms

Hi All,

What is the simplest way of getting the matched terms of the query with
respect to the document. So for example let's say a document has field X and
the contains of the field are "a b c" now when I do a search for 'b c'. The
document will be returned I want to get back the terms that this document
matched with the query terms. Can someone tell me the easiest way to
accomplish this.

--Thanks and Regards
Vaijanath

-- 
I am feeling fine, healthier and Happier, what about you

Re: How to get matched terms

Posted by Benjamin Heilbrunn <be...@gmail.com>.
You could use Query.extractTerms(..) and then search for possible
matches in the field term vector (requires stored TV).

2010/1/28 Vaijanath Rao <va...@gmail.com>:
> Hi All,
>
> What is the simplest way of getting the matched terms of the query with
> respect to the document. So for example let's say a document has field X and
> the contains of the field are "a b c" now when I do a search for 'b c'. The
> document will be returned I want to get back the terms that this document
> matched with the query terms. Can someone tell me the easiest way to
> accomplish this.
>
> --Thanks and Regards
> Vaijanath
>
> --
> I am feeling fine, healthier and Happier, what about you
>

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