cch123/elasticsql

convert error : nend convert select sql fields to json fields like `"_source":["title", "price"]`

gudigudi opened this issue · 2 comments

original SQL :

select title, price from products where title = '%A%'

expect like that :

{
    "_source": [
        "title",
        "price",
    ],
    "query": {
        "bool": {
            "must": [
                {
                    "match_phrase": {
                        "title": {
                            "query": "%A%"
                        }
                    }
                }
            ]
        }
    },
    "from": 0,
    "size": 1
} 

actually, elasticsql.Convert(sql) didn't generate "_source":["title", "price"]

@gudigudi ,想不起来这个当时为啥没支持了。。会有啥影响么

sql支持只select特定字段,es的查询也支持。实际使用中有这类需求的。