Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gudigudi opened this issue Aug 30, 2020 · 2 comments

Comments

@gudigudi
Copy link

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"]

@cch123
Copy link
Owner

cch123 commented Sep 7, 2020

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

@gudigudi
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants