|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 2022-04-15 14:14  yanqi_vip  阅读(26)  评论(0)    收藏  举报

导航