lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Berrettini" <>
Subject BooleanQuery
Date Thu, 13 Feb 2003 17:04:18 GMT
I'm having some trouble retrieving data I need from a combined query.

Here's what I'm trying to do: I want to search on several fields of my
documents and then return the best hits. I'm doing something like this:
   bodyQuery =
                QueryParser.parse(queryString.toLowerCase(), "body",

   subjectQuery =
                QueryParser.parse(queryString.toLowerCase(), "subject",

   attachmentsQuery =
"attachmentsText", analyzer);

            BooleanQuery bQuery = new BooleanQuery();
            bQuery.add(attachmentsQuery, false, false);

            Hits hits =;

All well and good. But when I'm displaying the results, I want to know which
fields were responsible for the hit. It doesn't seem like this is something
that is available within in the hit. One option is to search again in all
hits for the field where this occurred. That doesn't seem efficient. Another
is to conduct several queries, but then merging the results becomes a little
problematic. Any recommendations of which way to go?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message