Mailing List Archive

Recommended way of performing multi-field searches
This is a repost of a question posted to jGuru Lucene Forum. Didn't get a response there so I'm trying my luck here...

What's the recommended way of performing multi-field searches?

a.. Programmatically adding a :[field] for each field to the query and parsing this query?
Thanks

Sincerely,
Kelvin Tan

Relevanz Pte Ltd
180B Bencoolen St.
The Bencoolen, #04-01
S(189648)

Tel: 238-6229
RE: Recommended way of performing multi-field searches [ In reply to ]
> This is a repost of a question posted to jGuru Lucene Forum.
> Didn't get a response there so I'm trying my luck here...
>
> What's the recommended way of performing multi-field searches?
>
> a.. Programmatically adding a :[field] for each field to the
> query and parsing this query?


Just use the query parser, you can specify field specific searches using the
format field:text.
Eg, "title:cat author:james"

Dave Kor Kian Wei
Consultant
Product Engineering
NexusEdge Technologies Pte. Ltd.
6 Aljunied Ave 3, #01-02 (Level 4)
Singapore 389932
Tel : (+65)848-2552
Fax : (+65)747-4536
Web : www.nexusedge.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: Recommended way of performing multi-field searches [ In reply to ]
I'm looking for something a little more complex.

If there are say 5 fields to be searched, and the same query needs to be
searched across x fields, do we expect the user to type out
"{field1}:{query} {field2}:{query}{field3}:{query} ...{fieldx}:{query}" ? I
think not...

Which means that we've to implement something which adds the selected fields
to search programmatically...

I'll take a look at QueryParser.jj and see what I can come up with...

----- Original Message -----
From: Dave Kor <dave.kor@nexusedge.com>
To: Lucene Users List <lucene-user@jakarta.apache.org>
Sent: Monday, November 12, 2001 6:23 PM
Subject: RE: Recommended way of performing multi-field searches


> > This is a repost of a question posted to jGuru Lucene Forum.
> > Didn't get a response there so I'm trying my luck here...
> >
> > What's the recommended way of performing multi-field searches?
> >
> > a.. Programmatically adding a :[field] for each field to the
> > query and parsing this query?
>
>
> Just use the query parser, you can specify field specific searches using
the
> format field:text.
> Eg, "title:cat author:james"
>
> Dave Kor Kian Wei
> Consultant
> Product Engineering
> NexusEdge Technologies Pte. Ltd.
> 6 Aljunied Ave 3, #01-02 (Level 4)
> Singapore 389932
> Tel : (+65)848-2552
> Fax : (+65)747-4536
> Web : www.nexusedge.com
>
>
>
> --
> 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: Recommended way of performing multi-field searches [ In reply to ]
I think I've addressed my little problem. What I did was extend QueryParser
and in that class, implement a method which constructs a Query based on the
appropriate fields (I tried taking a look at QueryParser.jj, but gave up
after awhile...:)

If anyone's interested, I'd be happy to donate the code.

Regards,
Kelvin

----- Original Message -----
From: Kelvin Tan <kelvin@relevanz.com>
To: Lucene Users List <lucene-user@jakarta.apache.org>
Sent: Monday, November 12, 2001 6:51 PM
Subject: Re: Recommended way of performing multi-field searches


> I'm looking for something a little more complex.
>
> If there are say 5 fields to be searched, and the same query needs to be
> searched across x fields, do we expect the user to type out
> "{field1}:{query} {field2}:{query}{field3}:{query} ...{fieldx}:{query}" ?
I
> think not...
>
> Which means that we've to implement something which adds the selected
fields
> to search programmatically...
>
> I'll take a look at QueryParser.jj and see what I can come up with...
>
> ----- Original Message -----
> From: Dave Kor <dave.kor@nexusedge.com>
> To: Lucene Users List <lucene-user@jakarta.apache.org>
> Sent: Monday, November 12, 2001 6:23 PM
> Subject: RE: Recommended way of performing multi-field searches
>
>
> > > This is a repost of a question posted to jGuru Lucene Forum.
> > > Didn't get a response there so I'm trying my luck here...
> > >
> > > What's the recommended way of performing multi-field searches?
> > >
> > > a.. Programmatically adding a :[field] for each field to the
> > > query and parsing this query?
> >
> >
> > Just use the query parser, you can specify field specific searches using
> the
> > format field:text.
> > Eg, "title:cat author:james"
> >
> > Dave Kor Kian Wei
> > Consultant
> > Product Engineering
> > NexusEdge Technologies Pte. Ltd.
> > 6 Aljunied Ave 3, #01-02 (Level 4)
> > Singapore 389932
> > Tel : (+65)848-2552
> > Fax : (+65)747-4536
> > Web : www.nexusedge.com
> >
> >
> >
> > --
> > 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>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Recommended way of performing multi-field searches [ In reply to ]
On Mon, 2001-11-12 at 13:33, Kelvin Tan wrote:
> If anyone's interested, I'd be happy to donate the code.

Sounds cool - at the moment I just construct a string as some people
suggested, but it's less than elegant. Your solution sounds like a big
improvement.

Regards,

--
Lee Mallabone


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: Recommended way of performing multi-field searches [ In reply to ]
Here it is.

Feedback is most welcome.

Regards,
Kelvin
----- Original Message -----
From: Lee Mallabone <lee@grantadesign.com>
To: Lucene Users List <lucene-user@jakarta.apache.org>
Sent: Monday, November 12, 2001 10:12 PM
Subject: Re: Recommended way of performing multi-field searches


> On Mon, 2001-11-12 at 13:33, Kelvin Tan wrote:
> > If anyone's interested, I'd be happy to donate the code.
>
> Sounds cool - at the moment I just construct a string as some people
> suggested, but it's less than elegant. Your solution sounds like a big
> improvement.
>
> Regards,
>
> --
> Lee Mallabone
>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
>
>
RE: Recommended way of performing multi-field searches [ In reply to ]
Hi everyone!!

I've saw you discussion about multiple searches in Lucene and I think Kelvin
Tan
work was nice.. But I have a problem with it, how do a do a subquery on
multiple fields??

If I send in the "testa+testb" as a query the result turns out:
(realName:"support testa") (keywords:"support testa")



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