Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lucene QueryParser

Tags:

lucene

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

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

Thanks Tatyana

like image 441
Tatyana Solovyeva Avatar asked Nov 16 '08 03:11

Tatyana Solovyeva


2 Answers

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);
like image 157
CVertex Avatar answered Oct 20 '22 01:10

CVertex


version 5.0:

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

This is the newest api!

like image 28
hcjcch Avatar answered Oct 19 '22 23:10

hcjcch