Closed elyase closed 4 years ago
Good question :-)
Right now in Luqum there is none, and it would be difficult to do it in a general manner, as Elasticsearch query DSL is far more rich than Lucene Query DSL !
But if you have a known subset you want to translate, you could try build a tree using components in tree.py
and then simply using str()
on it you would have it's representation.
Use something like the visitor pattern on your ES query, and recursively build the tree.
great, thanks for the tips!
Good luck, I close the issue, so.
@alexgarel I am looking to build something similar, is there any interest for a PR in Luqum?
@isra17, as I told in my post above, it is interesting if you have a known subset of ES query DSL that you can translate into Lucene.
If you do something general enough, eg. that can translate any ES query generated by luqum back into Lucene (or nearly any, or a superset), yes it could be a good proposal. If it's pluggable to generalize, it would be even more interesting.
Hi, is there a way to go in the opposite direction, i.e.: Elasticsearch -> Lucene Query DSL