mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 12:32:21 +00:00
finish dist search engine
This commit is contained in:
parent
276fbac5f1
commit
14d588024f
@ -273,3 +273,9 @@ SQL 的 where 部分就是 boolean expression。我们之前提到过,这种 b
|
|||||||
当然可以,我们把 SQL 的 where 被 Parse 之后的结构和 es 的 DSL 的结构做个对比:
|
当然可以,我们把 SQL 的 where 被 Parse 之后的结构和 es 的 DSL 的结构做个对比:
|
||||||
|
|
||||||
TODO 这里有图
|
TODO 这里有图
|
||||||
|
|
||||||
|
既然结构上完全一致,逻辑上我们就可以相互转换。我们以广度优先对 AST 树进行遍历,然后将二元表达式转换成 json 字符串,再拼装起来就可以了,限于篇幅,本文中就不给出示例了,读者朋友可以查看:
|
||||||
|
|
||||||
|
> github.com/cch123/elasticsql
|
||||||
|
|
||||||
|
来学习具体的实现。
|
Loading…
x
Reference in New Issue
Block a user