lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Search "_all" field with a term
Date Sat, 11 Oct 2014 08:56:27 GMT
Hi,

by default there is no "_all" field. E.g., Elasticsearch adds this special field depending
on your index mapping at the time of indexing the data. Internally this is  indexing every
field a second time into the "_all" field.

With Lucene you have to do this on yourself. An alternative would be to use another query
parser (like the SimpleQueryParser, see http://goo.gl/4blGsp) that allows to expand the query
to search on multiple fields with different weight factors.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: haiwei.xie-soulinfo [mailto:haiwei.xie@soulinfo.com]
> Sent: Saturday, October 11, 2014 5:10 AM
> To: java-user@lucene.apache.org
> Subject: Search "_all" field with a term
> 
> hi all,
> 
>     Does lucene support all fields with a term?  Can I use "_all" intead
> "fieldname"?
> 
>    As Lucene's APIs example code:
>      ...
>     // Parse a simple query that searches for "text":
>     QueryParser parser = new QueryParser(Version.LUCENE_CURRENT,
> "fieldname", analyzer);
>     Query query = parser.parse("text");
>      ...
> 
> Thanks
> --
> haiwei
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message