Term-level queries (精确值查询)
您可以使用 term-level queries(精确值查询)并根据结构化数据中的精确值查找文档。 结构化数据的示例包括日期范围,IP地址,价格或产品ID。
与 full-text queries (全文查询) 不同,term-level queries(精确值查询)不分析搜索词。 而是,精确值查询匹配存储在字段中的确切术语。
term-level queries 仍然使用normalizer属性对keyword字字段的搜索项进行标准化。 有关更多详细信息,请参见normalizer(规范化器)。
Types of term-level queries
-
term query
根据提供的字段,查找符合一条精确值的文档。类似mysql中的 “=”操作;
-
terms query
跟term query相似,查找符合一组精确值的文档
-
terms_set query
Returns documents that contain a minimum number of exact terms in a provided field. You can define the minimum number of matching terms using a field or script. -
range query
范围搜索
-
exists query
检查值是否存在,不返回具体的值
-
prefix query
前缀搜索
-
wildcard query
通配符搜索
-
regexp query
正则表达式搜索
-
fuzzy query
模糊匹配,类似mysql中的”like %关键词% “查询操作;
返回包含与搜索词相似的词的文档。 Elasticsearch使用Levenshtein编辑距离来衡量相似性或模糊性。
-
type query
查找索引下对应的type
-
ids query
根据给定的id搜索