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 tl...@igb.uiuc.edu on 2006/01/10 19:53:29 UTC
Default searching across all fields?
Is there a way to make the default search to go across all fields?
For example, suppose I have two fields "title" & "content", and we have
the following:
String queryText = "dogs cats";
QueryParser qParser = ...;
Query query = qParser.parse(queryText); // uses DFLT field.
But what if you want the query to go across ALL fields?
(I'm hoping there is an easier approach than expanding the query across
all fields and do a Boolean OR.)
thanks in advance,
Todd
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Default searching across all fields?
Posted by tl...@igb.uiuc.edu.
Ohh, I see now. That's perfect. I hadn't realized that was in the API.
thanks...
> I think you want to use the MultiFieldQueryParser instead of the
> QueryParser.
>
> tlittell@igb.uiuc.edu wrote:
>
>>Is there a way to make the default search to go across all fields?
>>
>>For example, suppose I have two fields "title" & "content", and we have
>>the following:
>>
>>String queryText = "dogs cats";
>>QueryParser qParser = ...;
>>
>>Query query = qParser.parse(queryText); // uses DFLT field.
>>
>>But what if you want the query to go across ALL fields?
>>
>>(I'm hoping there is an easier approach than expanding the query across
>>all fields and do a Boolean OR.)
>>
>>thanks in advance,
>>Todd
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>
>>
>
> --
> -------------------------------------------------------------------
> Grant Ingersoll
> Sr. Software Engineer
> Center for Natural Language Processing
> Syracuse University
> School of Information Studies
> 337 Hinds Hall
> Syracuse, NY 13244
>
> http://www.cnlp.org
> Voice: 315-443-5484
> Fax: 315-443-6886
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Default searching across all fields?
Posted by Grant Ingersoll <gs...@syr.edu>.
I think you want to use the MultiFieldQueryParser instead of the
QueryParser.
tlittell@igb.uiuc.edu wrote:
>Is there a way to make the default search to go across all fields?
>
>For example, suppose I have two fields "title" & "content", and we have
>the following:
>
>String queryText = "dogs cats";
>QueryParser qParser = ...;
>
>Query query = qParser.parse(queryText); // uses DFLT field.
>
>But what if you want the query to go across ALL fields?
>
>(I'm hoping there is an easier approach than expanding the query across
>all fields and do a Boolean OR.)
>
>thanks in advance,
>Todd
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>
--
-------------------------------------------------------------------
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
School of Information Studies
337 Hinds Hall
Syracuse, NY 13244
http://www.cnlp.org
Voice: 315-443-5484
Fax: 315-443-6886
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org