This simple library is basically a grammar for lalrpop that transforms a query in the lucene query syntax to a sql where clause.
---Lucene---
field:(a OR b)
---SQL---
field = 'a' OR field = 'b'
---Lucene---
a:(1 OR c*)
---SQL---
field = 1 OR field like 'c%'
---Lucene---
((ee:\"val\" OR ee:*toma) AND NOT p:[* TO pepe]) AND a:(what OR no AND >=2) OR c:(>=awesome OR <excellent)
---SQL---
((ee = 'val' OR ee like '%toma') AND NOT p <= 'pepe') AND (a = 'what' OR a = 'no' AND a >= 2) OR (c >= 'awesome' OR c < 'excellent')
TODO
LuceneQS can get single values without specifying any field, sql engines no, this is a limitation on the query parsing, to solve this I'm building an API where you can set the fields you want to lookup if a raw value is set so it will treat them like:
---Lucene---
myvalue
---SQL Field specidied [name, description, body, summary]---
name = 'myvalue' OR description = 'myvalue' OR body = 'myvalue' OR summary = 'myvalue'
You probably noticed that when you use term:value
the translation is term = 'value'
but in LQS would like term like '%value%'
. I'm planning on changing it or leaving that configurable, I'd like to restrict that for perf reasons in some of my proyect but then the syntax translation is not correct and would make others not use it.
There is a few things not supported that are going to be, but there are others that won't.