|NO.Z.00021|——————————|BigDataEnd|——|Hadoop&ElasticSearch.V21|——|ELK.v21|集群|QueryDSL|词条级搜索.V1|

一、词条级搜索(term-level queries)
### --- 词条级搜索

~~~     可以使用term-level queries根据结构化数据中的精确值查找文档。
~~~     结构化数据的值包括日期范围、IP地址、价格或产品ID。
~~~     与全文查询不同,term-level queries不分析搜索词。
~~~     相反,词条与存储在字段级别中的术语完全匹配。
### --- 词条级搜索示例

PUT /book
{
  "settings": {},
  "mappings" : {
  "properties" : {
  "description" : {
  "type" : "text",
  "analyzer" : "ik_max_word"
  },
  "name" : {
  "type" : "text",
  "analyzer" : "ik_max_word"
  },
  "price" : {
  "type" : "float"
  },
  "timestamp" : {
  "type" : "date",
  "format" : "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
  }
  }
  }
}
PUT /book/_doc/1
{
  "name": "lucene",
  "description": "Lucene Core is a Java library providing powerful indexing and search features, as well as spellchecking, hit highlighting and advanced analysis/tokenization capabilities. The PyLucene sub project provides Python bindings for Lucene Core. ",
  "price":100.45,
  "timestamp":"2021-11-21 19:11:35"
}
PUT /book/_doc/2
{
  "name": "solr",
  "description": "Solr is highly scalable, providing fully fault tolerant distributed indexing, search and analytics. It exposes Lucenes features through easy to use JSON/HTTP interfaces or native clients for Java and other languages.",
  "price":320.45,
  "timestamp":"2021-11-21 17:11:35"
}
PUT /book/_doc/3
{
  "name": "Hadoop",
  "description": "The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models.",
  "price":620.45,
  "timestamp":"2021-11-22 19:18:35"
}
PUT /book/_doc/4
{
  "name": "ElasticSearch",
  "description": "Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java语言开发的,并作为Apache许可条款下的开放源码发布,是一种流行的企业级搜索引擎。Elasticsearch用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。官方客户端在Java、.NET(C#)、PHP、Python、Apache Groovy、Ruby和许多其他语言中都是可用的。根据DB-Engines的排名显示,Elasticsearch是最受欢迎的企业搜索引擎,其次是Apache Solr,也是基于Lucene。",
  "price":999.99,
  "timestamp":"2021-11-15 10:11:35"
}

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(18)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示