Highlighting is the way to go.  Note, you have options to make it better suit 
your application.  e.g. You can control the delimiters the highlighter uses.   
You can also choose from a couple different implementations.   We have been 
able to use the highlight results, as is, to pull data from fields which match 
the query.  Works fine.

That said, Damian Dykman was asking for highlight results in object form 
recently.  And Simon (Rosenthal?) responded with a link to SOLR-4722, which 
includes a patch for such a highlighter.   Might be worth a look.

https://issues.apache.org/jira/browse/SOLR-4722


-----Original Message-----
From: Steven White [mailto:swhite4...@gmail.com] 
Sent: Tuesday, March 31, 2015 5:42 PM
To: solr-user@lucene.apache.org
Subject: How to find out which fields a search came from

Hi folks,

When I get my hits back from Solr, is there a way to find out into which fields 
my search term matched in?

For example, if the indexed document is:

  doc_1:
    title = From Russia with Love
    director = Terence Young
    starting = Sean Connery, Redro Amendariz, Lotte Lenya,
    music_by = John Barry
doc_2:
    title = Goldfinger
    director = Guy Hamilton
    starting = Sean Connery, Honor Blackman, Gert Frobe
    music_by = John Barry
doc_3:
    title = Skyfall
    director = Sam Mendes
    starting = Daniel Craig, Javier Bardem, Ralph Fiennes
    music_by = Thomas Newman

If my search term is "love john barry guy", Solr will tell me I have a hit in 
doc_1 and doc_2.  But what I also need to know in which field my search terms 
match.  How can Solr tell me that doc_1::title and doc_1::music_by and 
doc_2::music_by are where my search terms matched?

It looks to me that the highlighter does this, but I need this feature without 
enabling the highlighter.

Thanks!

Steve

*************************************************************************
This e-mail may contain confidential or privileged information.
If you are not the intended recipient, please notify the sender immediately and 
then delete it.

TIAA-CREF
*************************************************************************

Reply via email to