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

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"
        
            }
        }
    }
}
主站蜘蛛池模板: 江津市| 阳江市| 博湖县| 鄢陵县| 青河县| 宿松县| 蒲城县| 诏安县| 东兴市| 临海市| 抚顺县| 北碚区| 新津县| 蒙自县| 惠水县| 乐昌市| 南江县| 当阳市| 东明县| 宜黄县| 恩施市| 恩平市| 唐河县| 南平市| 怀安县| 栾川县| 青阳县| 伊通| 剑河县| 柘城县| 灵台县| 垫江县| 威宁| 邵阳县| 根河市| 大埔县| 灵武市| 肥城市| 罗甸县| 澳门| 博野县|