You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by angry127 <an...@gmail.com> on 2009/10/20 02:58:15 UTC
Retrieve Matching Term
Hi,
Is it possible to get the matching terms from your query for each document
returned without using highlighting.
For example if you have the query "aaa bbb ccc" and one of the documents has
the term "aaa" and another document has the term "bbb" and "ccc".
To have Solr return:
Document 1: "aaa"
Document 2: "bbb ccc"
I was told this is possible using Term Vectors. I have not been able to find
a way to do this using Term Vectors. The only reason I am against using
highlighting is for performance reasons.
Thanks.
--
View this message in context: http://www.nabble.com/Retrieve-Matching-Term-tp25967886p25967886.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Retrieve Matching Term
Posted by Avlesh Singh <av...@gmail.com>.
If you query looks like this -
q=(myField:aaa myField:bbb myField:ccc)
you would get the desired results for any tokenized field (e.g. text) called
myField.
Cheers
Avlesh
On Tue, Oct 20, 2009 at 6:28 AM, angry127 <an...@gmail.com> wrote:
>
> Hi,
>
> Is it possible to get the matching terms from your query for each document
> returned without using highlighting.
>
> For example if you have the query "aaa bbb ccc" and one of the documents
> has
> the term "aaa" and another document has the term "bbb" and "ccc".
>
> To have Solr return:
>
> Document 1: "aaa"
> Document 2: "bbb ccc"
>
> I was told this is possible using Term Vectors. I have not been able to
> find
> a way to do this using Term Vectors. The only reason I am against using
> highlighting is for performance reasons.
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Retrieve-Matching-Term-tp25967886p25967886.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Re: Retrieve Matching Term
Posted by Chris Hostetter <ho...@fucit.org>.
: Is it possible to get the matching terms from your query for each document
: returned without using highlighting.
...
: I was told this is possible using Term Vectors. I have not been able to find
I'm not 100% familiar with the TermVectorComponent, but as i understand it
it gives you back all the Term Vectors for the matching documents -- it
doens't attempt to filter that list based on query string (it has no way
of knowing which terms actualy contributed to the match), so you
would have to parse the output and look for the keywords.
: a way to do this using Term Vectors. The only reason I am against using
: highlighting is for performance reasons.
highlighting works either by re-analyzing the stored values at query time,
or by looking at the Term Vectors -- so if you have TermVectors turned on
in your schema you've already saved 90% of what typicaly makes
highlighting slow. THe onlything missing would be a Fragmenter that
generated *just* the matching terms as their own fragments without any
special markup.
-Hoss