What is Luqum¶
Luqum stands for LUcene QUery Manipolator.
It features a python library with a parser for the Lucene Query DSL as found in Solr query syntax or ElasticSearch query string
From the parser it builds a tree (see Parsing).
This tree can eventually be manipulated and then transformed back into a query string, or used to generate other form of query.
In particular, luqum ships with a utility to transform a lucene query into a query using Elasticsearch query DSL language (in json form). (see Transforming to elastic query)
You may use this to:
make some sanity check on query
make your own check on query (eg. forbid certain fields)
replace some expressions in query
pretty print a query
inject queries in queries
extend lucene query language semantics
The parser is built using PLY.
Luqum is dual licensed under Apache2.0 and LGPLv3.
Warning
While used in production by our team for some time, this library is still a work in progress and also lacks some features.
Contributions are welcome.