We had a similar problem, when searching we wanted to return the doc, and for the multi-valued field we wanted to show only the value that matched the search. This was used for an advanced auto suggestion.
As Upaya specified, Highlighting was the good solution for us. Managing in the UI only the unit of information coming from the highlighting. Cheers 2015-05-26 9:42 GMT+01:00 Upayavira <u...@odoko.co.uk>: > The result that Solr returns is the document, not anything beneath, so > no, you cannot do this. > > You could use highlighting, you could parse the output of explains > (&debug.explains.structured=true will help) to identify which field > triggered the match. Alternatively, you could use block joins. Make a > parent doc and each of your colours as child docs, then you could return > which doc matched. You could use the ExpandComponent to retrieve details > of the parent doc (http://heliosearch.org/expand-block-join/) > > Dunno if any of that helps. > > Upayavira > > On Tue, May 26, 2015, at 08:33 AM, Rodolfo Zitellini wrote: > > Dear List, > > In my schema I have a couple multi value fields and I would need to > > retrive > > the index of which one generated a match. For example let's suppose I > > have > > a text field like this with three values: > > > > MyField: > > [0] Red > > [1] Blue > > [2] Green > > > > Searching for "Blue" gets me the document, but I would also need the > > index > > (1) in the multi value field. I tried using the highligter but it is a > > bit > > hackish then to calculate the index. Is it possible without resorting to > > highlighting? > > Thanks! > > Rodolfo > -- -------------------------- Benedetti Alessandro Visiting card : http://about.me/alessandro_benedetti "Tyger, tyger burning bright In the forests of the night, What immortal hand or eye Could frame thy fearful symmetry?" William Blake - Songs of Experience -1794 England