You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by ruchi thakur <ru...@gmail.com> on 2007/02/25 08:30:42 UTC

Querying multiple fields in a document

 Hello,
I am new to Lucene.
I have a document with 3 fields -   name,subject,rollno

I want to search on the 2 field names name and subject
ie; i want to search for documents having a particular combination of name
and subject, (say all the documents with name as bob and subject as maths) .
Would appreciate if i can have any ideas on this.
Thanks and Regards,
Ruchika

Re: Querying multiple fields in a document

Posted by Nicolas Lalevée <ni...@anyware-tech.com>.
Le dimanche 25 février 2007 12:35, Laxmilal Menaria a écrit :
> Hi, i think you will use MultiSearcher and create a field and Value array
> for that, that will solve your problem..

I don't know what was your issue Laxmilal, but Ruchika just need a simple 
query : "+name:bob +subject:maths".

Nicolas

>
> thanks
>
> On 2/25/07, ruchi thakur <ru...@gmail.com> wrote:
> > Hello,
> > I am new to Lucene.
> > I have a document with 3 fields -   name,subject,rollno
> >
> > I want to search on the 2 field names name and subject
> > ie; i want to search for documents having a particular combination of
> > name and subject, (say all the documents with name as bob and subject as
> > maths) .
> > Would appreciate if i can have any ideas on this.
> > Thanks and Regards,
> > Ruchika

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Querying multiple fields in a document

Posted by Laxmilal Menaria <lm...@chambal.com>.
Hi, i think you will use MultiSearcher and create a field and Value array
for that, that will solve your problem..

thanks

On 2/25/07, ruchi thakur <ru...@gmail.com> wrote:
>
> Hello,
> I am new to Lucene.
> I have a document with 3 fields -   name,subject,rollno
>
> I want to search on the 2 field names name and subject
> ie; i want to search for documents having a particular combination of name
> and subject, (say all the documents with name as bob and subject as maths)
> .
> Would appreciate if i can have any ideas on this.
> Thanks and Regards,
> Ruchika
>