java - alternative for MultiFieldQueryParser -
i new lucene. want have search on multiple field. doing thing this
query q = null;         try {             q = new multifieldqueryparser(version.latest,fields,new standardanalyzer(version.latest)).parse(strsearch);             int hitsperpage = 10;             topscoredoccollector collector = topscoredoccollector.create(hitsperpage, true);              searcher.search(q, collector);             return collector.topdocs().scoredocs;         } catch (org.apache.lucene.queryparser.classic.parseexception | ioexception e) {             e.printstacktrace();         } it work fine me want want know alternative  multifieldqueryparser , standardanalyzer. shows deprecated in lucene 4.10.
no need specify version(version.latest) using following constructor issue resolved me.
multifieldqueryparser(string[] fields, analyzer analyzer)
Comments
Post a Comment