Hello,World

elasticsearch中有没有类似 select * from tbl_user where user_id = seller_id 这种属性值相同的查询

Elasticsearch | 作者 delu | 发布于2016年04月23日 | 阅读数:4056

user_id 和 seller_id 都是tbl_user里的属性
已邀请:

wenjoe - 苦逼屌丝男

赞同来自:

我理解:就是term

ilangge

赞同来自:

建议使用 elasticsearch-sql 插件,真是神器,只要会sql,基本不用写es查询,自动翻译、自动出结果。
https://github.com/NLPchina/elasticsearch-sql
你值得拥有。

比如:
select title,contents,rq from tax9cn/t12366 where (contents like '%回租%') or  (contents like '%返租%') 

解析成:
{
    "from": 0,
    "size": 200,
    "query": {
        "bool": {
            "must": {
                "bool": {
                    "should": [
                        {
                            "wildcard": {
                                "contents": "*回租*"
                            }
                        },
                        {
                            "wildcard": {
                                "contents": "*返租*"
                            }
                        }
                    ]
                }
            }
        }
    },
    "_source": {
        "includes": [
            "title",
            "contents",
            "rq"
        ],
        "excludes": []
    }
}

要回复问题请先登录注册