esquery

description

Syntax

boolean esquery(varchar field, varchar QueryDSL)

通过esquery(field, QueryDSL)函数将一些无法用sql表述的query如match_phrase、geoshape等下推给Elasticsearch进行过滤处理. esquery的第一个列名参数用于关联index,第二个参数是ES的基本Query DSL的json表述,使用花括号{}包含,json的root key有且只能有一个, 如match_phrase、geo_shape、bool等

example

1. match_phrase查询:

3. select * from es_table where esquery(k4, '{
4. "match_phrase": {
5. "k4": "doris on es"
6. }
7. }');

10. geo相关查询:

12. select * from es_table where esquery(k4, '{
13. "geo_shape": {
14. "location": {
15. "shape": {
16. "type": "envelope",
17. "coordinates": [
18. [
19. 13,
20. 53
21. ],
22. [
23. 14,
24. 52
25. ]
26. ]
27. },
28. "relation": "within"
29. }
30. }
31. }');

keywords

1. esquery