1
votes

I'm implementing an SQL-like query parser which outputs Solr query. I know Solr/Lucene query is not entirely same as boolean query, like there are MUST/MUST NOT/SHOULD. But I have to parse SQL-like boolean query automatically because the interface of our customers is already adopts SQL-like one.

Simple parsing like "A and B" -> "A and B" is OK, but such as "NOT(A and (B or C)) AND D", I'm at a loss when SolrServer returns a value which I didn't intend.

I read the following

http://lucene.472066.n3.nabble.com/Unexpected-boolean-query-behavior-td487306.html

but it seems to be of Lucene and I couldn't make out how to connect lucene BooleanQuery to Solr. Does anyone have good idea?

1

1 Answers

0
votes

If you look at the Lucene Query Syntax documentation, you should be able to determine how Boolean query syntax maps to native Lucene (and Solr) query syntax. Looking at the Lucene source would also be instructive (I know the Lucene.NET sources are pretty readable from my work on Lucene Does Not Create Parse Trees).