Does the standard debug component (?debugQuery=on) give you what you need?

http://wiki.apache.org/solr/SolrRelevancyFAQ#Why_does_id:archangel_come_before_id:hawkgirl_when_querying_for_.22wings.22

- Jon

On May 14, 2010, at 4:03 PM, Tim Garton wrote:

> All,
>     I've searched around for help with something we are trying to do
> and haven't come across much.  We are running solr 1.4.  Here is a
> summary of the issue we are facing:
> 
> A simplified example of our schema is something like this:
> 
>   <field name="id" type="string" indexed="true" stored="true" required="true" 
> />
>   <field name="title" type="text" indexed="true" stored="true"
> required="true" />
>   <field name="date_posted" type="tdate" indexed="true" stored="true" />
>   <field name="supplement_title" type="text" indexed="true"
> stored="true" multiValued="true" />
>   <field name="supplement_pdf_url" type="text" indexed="true"
> stored="true" multiValued="true" />
>   <field name="supplement_pdf_text" type="text" indexed="true"
> stored="true" multiValued="true" />
> 
> When someone does a search we search across the title,
> supplement_title, and supplement_pdf_text fields.  When we get our
> results, we would like to be able to tell which field the search
> matched and if it's a multiValued field, which of the multiple values
> matched.  This is so that we can display results similar to:
> 
>    Example Title
>        Example Supplement Title
>        Example Supplement Title 2 (your search matched this document)
>        Example Supplement Title 3
> 
>    Example Title 2
>        Example Supplement Title 4
>        Example Supplement Title 5
>        Example Supplement Title 6 (your search matched this document)
> 
>    etc.
> 
> How would you recommend doing this?  Is there some way to get solr to
> tell us which field matched, including multiValued fields?  As a
> workaround we have been using highlighting to tell which field
> matched, but it doesn't get us what we want for multiValued fields and
> there is a significant cost to enabling the highlighting.  Should we
> design our schema in some other fashion to achieve these results?
> Thanks.
> 
> -Tim

Reply via email to