I have a question about queries in Solr. When I perform a query with multiple search terms that are all logically linked by OR (e.g. q=content:(foo OR bar OR foobar)
) than Solr returns a list of documents that all matches any of these terms. But what Solr does not return is which documents were hit by which term(s). So in the example above, what I want to know is which documents in my result list contains the term foo etc. Given this information I would be able to create a term-document matrix.
So my question is: how can I tell Solr to give me that missing piece of information? I'm sure it is somewhere, otherwise the search as a whole would not work. But what am I missing? Thanks for your help.
PS: As a workaround I'm performing a single Solr query for all the search terms. But as you can imagine it's a desaster in matters of performance as the number of search terms can exceed 50 :(
exists
function and add a pseudo field for every search term like so:fl=exists(query({!v='content:(foo)'})),exists(query({!v='content:(bar)'}))
. From the response I parse the search term with an Regex. – Lignify