官术网_书友最值得收藏!

Implementing a category filter

Normally, the category fields are of the type string. We need to index this unanalyzed field to match the exact term. In fact, Elasticsearch uses a term filter for the purpose of matching strings:

The following snippet shows you how to use a terms filter:

{
    "filtered" : {
        "filter" : {
            "term" : {
                "category" : "Books"
        
            }
        }
    }
}
主站蜘蛛池模板: 松溪县| 北安市| 谷城县| 普宁市| 伊吾县| 孙吴县| 阿勒泰市| 衡水市| 钟山县| 太康县| 长顺县| 剑阁县| 南漳县| 吉安县| 高雄市| 普洱| 南康市| 定南县| 宁河县| 富民县| 上虞市| 修文县| 连南| 庄河市| 新密市| 洮南市| 陆丰市| 西吉县| 侯马市| 台州市| 金门县| 临朐县| 长沙市| 镇远县| 磴口县| 天气| 丰镇市| 嘉义县| 轮台县| 府谷县| 虹口区|