Elasticsearch全文搜索

2020-03-30  本文已影响0人  莫问_68ff

https://www.jianshu.com/p/56cfc972d372
Elasticsearch多字段查询,以下语句是根据指定的值取消订单,查询所有字段出现这一值的数据

GET /auditlog202002/log/_search
{
  "query": {
    "bool": {
            "must": [],
            "filter": [
                {
                    "multi_match": {
                        "type": "best_fields",
                        "query": "取消订单",
                        "lenient": true
                    }
                },
                {
                    "range": {
                        "OrderContent.CreateTime": {
                            "format": "strict_date_optional_time",
                            "gte": "2019-02-13",
                            "lte": "2020-02-13"
                        }
                    }
                }
            ],
            "should": [],
            "must_not": []
        }
  }
}
上一篇 下一篇

猜你喜欢

热点阅读