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 Umar Shah <um...@wisdomtap.com> on 2008/04/09 12:41:50 UTC

Can I find the which field matched?

Hi,

If i through a query at the solr index , is there a mechanism where i can
find out which fields matced the query... (score of that match).

Example:
for Fields A,B and C,
if query q has term1 term2 term3
Field A matches term1 term 2
Field C matches term3

can i get component scores of the whole match as
MatchA
MatchB (0.0 perhaps)
MatchC

I will be using these scores from a custom plugin, What classes I need to
use for such scores?

-umar

Re: Can I find the which field matched?

Posted by Chris Hostetter <ho...@fucit.org>.
the Lucene Scorers don't keep track of component scores as they go, the 
cumulative score is calculated all at once.

For specific documents your plugin could use the SolrIndexSearcher.explain 
method to execute logic that will build up a data structure showing the 
intermediate calculations.


-Hoss