Comments (6)
目前暂时还不支持
这个好像写 sql 的时候没有相同语义的符号。。要是用其它的也挺奇怪的,目前依赖的这个 sql parser 里定义的条件表达式可以参考 这里
我初步想法是扩展一下加个自定义函数?
在这里的 switch 下面加一个 *sqlparser.FuncExpr 的 case,然后写类似这种的 SQL:
select * from aaa
where a=1
and multi_match(b, 'yes we can')
需要看看你们的具体需求
from elasticsql.
嗯,谢谢,还有就是查询字段null/not null 没实现,是因为版本不兼容吗?
from elasticsql.
@fengweiqiang ,我们当时没这个需求,因为 es 里的数据都是从 mysql 来的,而 mysql 的规范都会要求字段不为 null
from elasticsql.
嗯嗯,非常感想你的讲解
from elasticsql.
@fengweiqiang ,在这个分支上已经支持了,你那边测测吧,要是没问题,我合 master:
https://github.com/cch123/elasticsql/tree/feature_multi_match
package main
import (
"fmt"
"github.com/cch123/elasticsql"
)
var sql = `
select * from aaa
where a=1 and x = '三个男人'
and multi_match(query='this is a test', fields=(title,title.origin))
`
//and multi_match(query='this is a test', fields=(title,title.origin), type=phrase)
func main() {
dsl, esType, err := elasticsql.Convert(sql)
fmt.Println(dsl)
fmt.Println(esType)
fmt.Println(err)
}
可以提供 query、fields 或者 query、fields 和 type
from elasticsql.
我自己简单试了试没啥问题,#20
之后有问题可以 reopen 或者另开 issue
from elasticsql.
Related Issues (20)
- support more graceful missing check
- support aggregation alias
- support nested doc query
- date_histogram转换DSL有问题? HOT 1
- 有版本支持列表吗? HOT 1
- Is the example correct? HOT 2
- 你这个能不能做一个客户端 HOT 1
- Large Query HOT 3
- 简单查询语句报错 HOT 9
- 不支持bigint 值比较 HOT 1
- Multiple Group by errors HOT 3
- convert error : nend convert select sql fields to json fields like `"_source":["title", "price"]` HOT 2
- 支持这种子查询吗? HOT 1
- 能否支持escape? HOT 3
- sql translate 咨询 HOT 1
- nest HOT 3
- How can I do the vice-versa operation? HOT 1
- Does this library have the capability to perform a conversion from DSL to SQL? HOT 1
- 建议在Convert的时候,可以加入json pretty输出 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsql.