lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jitender ahuja" <>
Subject Re: multiple fields to be indexed
Date Thu, 17 Jun 2004 11:54:02 GMT
    Can u pl. clarify some more how to use the BooleanQuery class as I am
clueless still.
As far as I can gather it deals with multiple query terms and not with
searching a (may be single) given query term in multiple (indexed) fields.

----- Original Message ----- 
From: "Dmitry Serebrennikov" <>
To: "Lucene Developers List" <>
Sent: Monday, June 14, 2004 11:02 PM
Subject: Re: multiple fields to be indexed

> jitender ahuja wrote:
> >Hi all,
> >
> >I am trying to do a search on multiple fields of which some are indexed.
Now, a query can be posed to search in the indexed fields but the Hits class
object can have only one query object and the query class similarly can have
only one field on which the query is performed.
> >
> Take a look at BooleanQuery. That will allow you to combine multiple
> TermQueries, such that you can create a single query on different
> fields. That should do the trick.
> Good luck!
> Dmitry.
> >Now, to have multiple queries I need to obtain multiple Hits class
objects that are then merged  together in one array. But, I do not know how
to maintain the scorings obtained by different Hits class objects. If
somebody has tried such a thing or a different mechanism to feed a query to
different query objects, then pl. respond.
> >Actually I have not tried the above option of merging the results in a
final array but I feel that it should work.
> >
> >Regards
> >Jitender
> >
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message