简述
此过滤器,用于为经常出现的术语生成二进制码。 单项仍被索引。 当我们不想完全忽略常用术语时,它可以用作“ 停止令牌过滤器”的替代方法。如"the quick brown is a fox",将被过滤成 "the", "the_quick", "quick", "brown", "brown_is", "is_a", "a_fox", "fox"。假设“the”,“is”和“a”是常用词。
当启用query_mode
时,过滤器将删除常用单词和单个术语,后跟通用单词。 应在搜索分析器中启用此参数。如,"the quick brown is a fox" 将被过滤成 "the_quick", "quick", "brown_is", "is_a", "a_fox", "fox"。
参数
以下是常用设置:
设置 | 描述 |
---|---|
| 要使用的常用词列表。 |
| 路径(相对于 |
| 如果为真,通用单词匹配将不区分大小写(默认为 |
| 生成二进制,然后删除常用单词和单个术语,后跟一个通用单词(默认为 |
注意, common_words
或common_words_path
字段是必需的。
示例
如下所示:
index : analysis : analyzer : index_grams : tokenizer : whitespace filter : [common_grams] search_grams : tokenizer : whitespace filter : [common_grams_query] filter : common_grams : type : common_grams common_words: [a, an, the] common_grams_query : type : common_grams query_mode: true common_words: [a, an, the]