santik / sql-elasticsearch-query-converter
Library for converting AND OR SQL like query to Elastic Search query
0.1.5
2017-11-29 20:37 UTC
Requires
- php: ^7.0
- ramsey/uuid: ^3.7
This package is not auto-updated.
Last update: 2025-04-13 07:06:43 UTC
README
Converts AND OR SQL like query to Elastic Search query
((("query1 query 2" OR query3) OR query4) AND (query5 OR query6)) AND query7
TO
{"bool":{"must":[{"bool":{"must":[{"bool":{"should":[{"bool":{"should":[{"match_phrase":{"field":"query1 query 2"}},{"match":{"field":"query3"}}]}},{"match":{"field":"query4"}}]}},{"bool":{"should":[{"match":{"field":"query5"}},{"match":{"field":"query6"}}]}}]}},{"match":{"field":"query7"}}]}}
Installation
$ composer require santik/sql-elasticsearch-query-converter
Usage
Look at examples/example1.php