lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <li...@ehatchersolutions.com>
Subject Re: Searching on multiple default fields
Date Tue, 13 May 2003 10:08:32 GMT
Or as is often seen with Lucene usage, all fields can be glued together 
into a "contents" field, which is then used as the default search field 
like this:

doc.add(Field.Text("title", title));
doc.add(Field.UnIndexed("body", body));
doc.add(Field.Keyword("category",category));

doc.add(Field.UnStored("contents", title +
                 " " + body +
                 " " + category));

This gives individual field access if desired, but by default any field 
is searchable by one aggregate one.  Note the space added between text 
on the "contents" field above!

	Erik

On Tuesday, May 13, 2003, at 03:40  AM, Kelvin Tan wrote:
> You can use MultiFieldQueryParser to accomplish something to that 
> effect...
>
> Kelvin
>
> On Tue, 13 May 2003 13:05:42 +0530, Ramrakhiani, Vikas said:
>> Hi,
>>
>> I am using Lucene 1.3. I want the 'default' search field to point to
>> multiple fields (actually, all available fields).
>> Is there API support to accomplish this ?
>>
>> thanks for your help,
>> vikas.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


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


Mime
View raw message