Query Translation if where the qpl query, agnostic to this point, gets converted into an engine specific query
Translators Available
- ElasticsearchTranslator (from version 1.0.0)
- OpensearchTranslator (from version 1.0.4)
Translation
All the translators are located in the pakage pyqpl.translator currently, import the require one
Code Block |
---|
|
from pyqpl.translator import ElasticsearchTranslator |
Create an instante of the translatorÂ
Code Block |
---|
|
translator = ElasticsearchTranslator() |
And translate the qpl_query with the translator instance, is the same call for all translators
Code Block |
---|
|
engine_query = translator.to_engine_query(qpl_query) |