Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
languagepy
themeMidnight
from pyqpl.translator import ElasticsearchTranslator


Create an instante of the translator 

Code Block
languagepy
themeMidnight
translator = ElasticsearchTranslator()


And translate the qpl_query with the translator instance, is the same call for all translators

Code Block
languagepy
themeMidnight
engine_query = translator.to_engine_query(qpl_query)