美文网首页
Elasticsearch全文搜索

Elasticsearch全文搜索

作者: 莫问_68ff | 来源:发表于2020-03-30 18:22 被阅读0次

    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": []
            }
      }
    }
    

    相关文章

      网友评论

          本文标题:Elasticsearch全文搜索

          本文链接:https://www.haomeiwen.com/subject/vplbfhtx.html