Elasticsearch入门 互动版

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

Term Query


  term query在给定的字段里查询词或者词组。

curl -XGET  'http://localhost:9200/twitter/tweet/_search' -d '
{
  "query" :
  {
  "term" : { "user" : "Kimchy" }
  }
}
'

  TermMatch的区别,如下代实例

curl -XGET  'http://localhost:9200/my_index/my_type/_search' -d '
{
  "query": {
    "match": {
      "full_text": "Quick Foxes!" 
    }
  }
}
'

curl -XGET  'http://localhost:9200/my_index/my_type/_search' -d '
{
  "query": {
    "term": {
      "full_text": "Quick Foxes!" 
    }
  }
}
'

  在默认情况下,match是查询匹配"Quick"或者"Foxes!"或者"Quick Foxes!",而term只查询匹配"Quick Foxes!"。

term来查询索引为twitter,索引类型为tweetuserkimchy的文档记录。