Lucene QueryParser

Does Lucene QueryParser.parse (string) work? If it's out of date, what's the new syntax?

Query Request = QueryParser.parse ("Ophelia");

thanks Tatyana

+6
lucene
source share
2 answers

Not sure about the exact API, but it has changed to an instance object. All QueryParsers are now instances of objects.

var qp = new QueryParser(new StandardAnalyzer(),fields); qp.Parse(inputString,fields); 
+7
source share

version 5.0:

 QueryParser parser = new QueryParser(fields, new StandardAnalyzer()); Query query = parser.parse(searchString); 

This is the newest api!

+1
source share

All Articles