I am currently using Solr to do some searching across a large amount of documents. I need to be able to, on the client-side, allow grouping of search results on the fly but I’m having trouble trying to figure out how to get this extra data I need out of Solr and pushed up to the front end.
So basically, let’s say I’m searching for the following values: "Test", "Wee"
And I have the following documents in Solr:
Doc1: "This is a Test, Wee"
Doc2: "Wee"
Doc3: "This is a Test"
All 3 documents should be returned by Solr. What I’d like returned is something that contains this:
Doc1 matched on values "Test" and "Wee
Doc2 matched on value "Wee"
Doc3 matched on value "Test"
I’m a bit new to Solr so I’m having difficulty trying to figure out what to search for. Should I be using faceting for this?
Thanks!
It seems you have only one field you search upon, so faceting won’t really help you here (If each value came from a different field, that might be possible, what you suggested).
Instead, I suggest you take a look at highlighting utilities, which marks the matched term.
http://wiki.apache.org/solr/HighlightingParameters