First, "OR -ipod" needs to be written as "OR (*:* -ipod)" due to an ongoing deficiency in Lucene query parsing, but I wonder what you really think you are OR'ing in that clause - all documents that don't contain "ipod"? That seems odd. Maybe you really want to constrain the preceding query to exclude ipod? That would be:

(android OR google OR apple OR iphone) -ipod

-- Jack Krupansky

-----Original Message----- From: Michael Jakl
Sent: Wednesday, July 04, 2012 8:29 AM
To: solr-user@lucene.apache.org
Subject: Get all matching terms of an OR query

Hi,
is there an easy way to get the matches of an OR query?

If I'm searching for "android OR google OR apple OR iphone OR -ipod",
I'd like to know which of these terms document X contains.

I've been using debugQuery and tried to extract the info from the
explain information, unfortunately this is too slow and I'm having
troubles with the stemming of the query.

Using the highlight component doesn't work either because my fields
aren't stored (would the highlighter work with stemmed texts?)

We're using Solr 3.6 in a distributed setting. I'd like to prevent
storing the texts because of space issues, but if that's the only
reasonable solution... .

Thank you,
Michael

Reply via email to