Mailing List Archive

Querying multiple fields of a index
Hi,

Is it possible to query multiple fields of a given index and get the result
based on this combined query.
i.e for example if i want to serach for a word "lucene" in the title field
and the word "engine" in the summary filed and want the results based on
these words .

How can i achieve this ?

TIA

Regards
Harpreet



--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Querying multiple fields of a index [ In reply to ]
You can use MultipleFieldQueryParser class, included with Lucene.

Otis

--- Harpreet S Walia <xalanlist@yahoo.com> wrote:
> Hi,
>
> Is it possible to query multiple fields of a given index and get the
> result
> based on this combined query.
> i.e for example if i want to serach for a word "lucene" in the title
> field
> and the word "engine" in the summary filed and want the results based
> on
> these words .
>
> How can i achieve this ?
>
> TIA
>
> Regards
> Harpreet
>
>
>
> --
> 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! Tax Center - online filing with TurboTax
http://taxes.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>
RE: Querying multiple fields of a index [ In reply to ]
Hi,
I use a boolean query and add individual queries to it.

-----Original Message-----
From: Harpreet S Walia [mailto:xalanlist@yahoo.com]
Sent: Thursday, April 04, 2002 10:13 AM
To: Lucene Users List
Subject: Querying multiple fields of a index


Hi,

Is it possible to query multiple fields of a given index and get the result
based on this combined query.
i.e for example if i want to serach for a word "lucene" in the title field
and the word "engine" in the summary filed and want the results based on
these words .

How can i achieve this ?

TIA

Regards
Harpreet



--
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: Querying multiple fields of a index [ In reply to ]
Hi,

If you are using the queryParser and the standardAnalyzer you would use a
querystring like


title:lucene AND summary:engine


So the pattern is <field name>:<search string without spaces (unless your
searching a phrase)>

Also, you don't have to explicitly put the field name if you are searching
the default field. That is if title is the default field the search would
be

lucene AND summary:engine

Hope this helps.


--Peter


On 4/4/02 8:13 AM, "Harpreet S Walia" <xalanlist@yahoo.com> wrote:

> Hi,
>
> Is it possible to query multiple fields of a given index and get the result
> based on this combined query.
> i.e for example if i want to serach for a word "lucene" in the title field
> and the word "engine" in the summary filed and want the results based on
> these words .
>
> How can i achieve this ?
>
> TIA
>
> Regards
> Harpreet
>
>
>
> --
> 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: Querying multiple fields of a index [ In reply to ]
ok, the discussions are about passing some field names...

how about in situation where i don't have to pass any field name but
just do a complete search in all the fields...

hope someone can clarify....
Re: Querying multiple fields of a index [ In reply to ]
First of all lemme ask sorry to the forum (lucene-user) and you Otis (in
particular) for the previous mail.

That was supposed to be addressed to our in-house forum inorder for my
team-mates to gain some knowledge.
Actually, I know how to achieve this.

Sorry for the trouble again.

Mohamed Idrees wrote:

> ok, the discussions are about passing some field names...
>
> how about in situation where i don't have to pass any field name but
> just do a complete search in all the fields...
>
> hope someone can clarify....