Mailing List Archive

Multiple queries
Hi

How can I create a searcher which searcher for multiplequeries.

Example
assume that I store indexes in ramdirectory named 'rdir'

let my first query query1 = "name:pradeep";
second query query2 = "age:22";
Hits hits= indSe.search(the_quer);

I know the following will return no of hits for the query query1
Hits hits = indSe.search(query1);

But how can I get hits for a compination of queries query1 AND query2.

TIA
Pradeep


--------------------------------------------------------------
Robosoft Technologies, Mangalore, India



--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Multiple queries [ In reply to ]
On Sun, 30 Jun 2002, Pradeep Kumar K wrote:

Can't you just make one query which does "name:pradeep age:22"


> Hi
>
> How can I create a searcher which searcher for multiplequeries.
>
> Example
> assume that I store indexes in ramdirectory named 'rdir'
>
> let my first query query1 = "name:pradeep";
> second query query2 = "age:22";
> Hits hits= indSe.search(the_quer);
>
> I know the following will return no of hits for the query query1
> Hits hits = indSe.search(query1);
>
> But how can I get hits for a compination of queries query1 AND query2.
>
> TIA
> Pradeep
>
>
> --------------------------------------------------------------
> Robosoft Technologies, Mangalore, India
>
>
>
> --
> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Multiple queries [ In reply to ]
Use can use BooleanQuery for this (check the Javadoc on the site for
method names), or if it's easier for you try using QueryParser.

Otis


--- Pradeep Kumar K <pradeepk@robosoftin.com> wrote:
> Hi
>
> How can I create a searcher which searcher for multiplequeries.
>
> Example
> assume that I store indexes in ramdirectory named 'rdir'
>
> let my first query query1 = "name:pradeep";
> second query query2 = "age:22";
> Hits hits= indSe.search(the_quer);
>
> I know the following will return no of hits for the query
> query1
> Hits hits = indSe.search(query1);
>
> But how can I get hits for a compination of queries query1 AND
> query2.
>
> TIA
> Pradeep
>
>
> --------------------------------------------------------------
> Robosoft Technologies, Mangalore, India
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>