6
votes

Does Lucene QueryParser.parse(string) still work? If it is deprecated, what is the new syntax?

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

Thanks Tatyana

2
Please consider marking an answer as correctCVertex

2 Answers

7
votes

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

var qp = new QueryParser(new StandardAnalyzer(),fields);
qp.Parse(inputString,fields);
1
votes

version 5.0:

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

This is the newest api!