Hi, Thanks for your advise, SimpleQueryParser api is not enough in my case. Actually, I want to index data from database, there are so many fields, I have tested "_all" parameter in ElasticSearch system, but the result of '_all' and 'fieldname' are different for chinese term.
'Internally this is indexing every field a second time into the "_all" field.' This sentence mean second indexing has total different analyzer and indexing compared with my first indexing? So I need rewrite the second process to fix my problem? Thanks. Haiwei > 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: u...@thetaphi.de > > > > -----Original Message----- > > From: haiwei.xie-soulinfo [mailto:haiwei....@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-unsubscr...@lucene.apache.org > > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > -- haiwei --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org