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 Wermus Fernando <fe...@xlnet.net.ar> on 2004/08/12 17:44:43 UTC

newbie: about grouping field

Luceners
I have to search a string in 30 fields. I know how to do it in a long
way. I wanna know if exists a shorter way.
 
String for searching: what's your name?
Long way: +firstname:what's your name?  OR +lastname: what's your name?
OR .......
 
A shorter way: (firstname OR lastname OR ....):what's your name?
 
Is it possible? Our searching is always the same kind of searching.
 
Thanks in advance

Re: newbie: about grouping field

Posted by Ype Kingma <yk...@xs4all.nl>.
Fernando,

On Thursday 12 August 2004 17:44, Wermus Fernando wrote:
> Luceners
> I have to search a string in 30 fields. I know how to do it in a long
> way. I wanna know if exists a shorter way.
>
> String for searching: what's your name?
> Long way: +firstname:what's your name?  OR +lastname: what's your name?
> OR .......
>
> A shorter way: (firstname OR lastname OR ....):what's your name?
>
> Is it possible? Our searching is always the same kind of searching.

Two ways: org.apache.lucene.queryParser.MultiFieldQueryParser
or querying an extra field that contains all current fields to be searched.

The latter is normally faster, but takes more index space. It's normally
preferred when this type of query occurs frequently.
Also the query results might be ordered somewhat differently in both cases.

Kind regards,
Ype



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