通配符查询 wildcard

? 匹配任意字符
* 匹配0个或多个字符

query = {
            "track_total_hits": "true",
            "query": {
                "bool": {
                    "filter": [
                        {
                            "wildcard": {
                                "A.keyword": "*"
                            }
                        }
                    ]
                }
            },
            "size": 0,
            "aggs": {
                "nums": {
                    "cardinality": {
                        "field": "A.keyword"
                    }
                }
            }
        }
  • 包含某个子字符串
             {
                    "wildcard": {
                        "标题.keyword": {
                            "value": "*子字符串*"
                        }
                    }
                }

你可能感兴趣的:(通配符查询 wildcard)