首页
视频
资源
登录
原
Elasticsearch Search API概览
4318
人阅读
2020/9/11 13:42
总访问:
2615430
评论:
0
收藏:
0
手机
分类:
云产品
![elasticsearch](https://img.tnblog.net/arcimg/hb/5f1adabe8df94fdb8331eb80e393c4a3.jpeg "elasticsearch") >#Elasticsearch Search API概览 [TOC] Search API ------------ tn>通过搜索获取的数据方式有两种。 >- URL Search - 在URL中使用查询参数,通过Get的请求方式去获取数据。 - Request Body Search - 使用 Elasticsearch 提供的,基于 JSON 格式的更加完备的 Query Domain Specific Language (DSL) 指定查询的索引 ------------ | 语法 | 范围 | | ------------ | ------------ | | /_search | 集群上所有的索引 | | /index1/_search | index1 | | /index1,index-2/_search | index1和index2 | | /index*/_search | 以index开头的索引 | URL 查询 ------------ - 使用"q",指定查询字符串 - “query string syntax”, KV 键值对 tn>这里的`q`用来表示查询的内容,查询一个叫Eddie的客户 ```bash curl -XGET "http://elasticsearch:9200/kibana_sample_data_ecommerce/_search?q=customer_first_name:Eddie" ``` Request Body 查询 ------------ ```bash curl -XGET "http://elasticsearch:9200/kibana_sample_data_ecommerce/_search" -H 'Content-Type: application/json' -d ' { "query":{ "match_all"{} } } ' ``` | 名称 | 特点 | | ------------ | ------------ | | -XGET | 支持POST和GET两种请求方式 | | kibana_sample_data_ecommerce | 需要操作的索引名 | | _search | 执行索引的操作 | | query | 查询 | | match_all | 返回所有的文档 | 搜索后的相应结果 ------------ tn>Json这里待补充。。。 | 名称 | 意义 | | ------------ | ------------ | | took | 花费的时间 | | _shards/total | 结果数量 | | hits | 表示本次查询的结果项 | | hits/total | 符合条件的总文档数 | | hits/hits | 结果集,默认前10个文档 | | hits/hits/_index | 索引名 | | hits/hits/_id | 文档的Id | | hits/hits/_score | 相关度评分 | | hits/hits/_source | 文档原始信息 | 搜索的相关性 Relevance ------------ >- 搜索是用户和搜索引擎的对话 - 用户关心的是搜索结果的相关性 - 是否可以找到所有相关的内容 - 有多少不相关的内容被返回了 - 文档的打分是否合理 - 结合业务需求,平衡结果排名 Web常规搜索 ------------ >- 使用Page Rank 算法 - 不仅仅是内容 - 更重要的是内容的可信度 电商搜索 ------------ >- 搜索引擎扮演 - 销售的角色 - 提高用户购物体验 - 提升网站销售业绩 - 去库存 衡量相关性 ------------ >- Information Retrieval - Precision(查准率) - 尽可能返回较少的无关文档 - Recall(查全率)- 尽量返回较多的相关文档 - Ranking - 是否能够安装相关进度进行排序 Precision & Recall ------------ >- Precision - True Positive / 全部返回的结果(True and False ) - Recall - True Positive / 所有应该返回的结果(True positives + false Negtives) tn>使用 Elasticsearch 的查询和相关的参数改善搜索的 Precision 和 Recall
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
👈{{preArticle.title}}
👉{{nextArticle.title}}
评价
{{titleitem}}
{{titleitem}}
{{item.content}}
{{titleitem}}
{{titleitem}}
{{item.content}}
尘叶心繁
这一世以无限游戏为使命!
博主信息
排名
6
文章
6
粉丝
16
评论
8
文章类别
.net后台框架
168篇
linux
17篇
linux中cve
1篇
windows中cve
0篇
资源分享
10篇
Win32
3篇
前端
28篇
传说中的c
4篇
Xamarin
9篇
docker
15篇
容器编排
101篇
grpc
4篇
Go
15篇
yaml模板
1篇
理论
2篇
更多
Sqlserver
4篇
云产品
39篇
git
3篇
Unity
1篇
考证
2篇
RabbitMq
23篇
Harbor
1篇
Ansible
8篇
Jenkins
17篇
Vue
1篇
Ids4
18篇
istio
1篇
架构
2篇
网络
7篇
windbg
4篇
AI
18篇
threejs
2篇
人物
1篇
嵌入式
2篇
python
13篇
HuggingFace
8篇
pytorch
9篇
opencv
6篇
Halcon
1篇
最新文章
最新评价
{{item.articleTitle}}
{{item.blogName}}
:
{{item.content}}
关于我们
ICP备案 :
渝ICP备18016597号-1
网站信息:
2018-2024
TNBLOG.NET
技术交流:
群号656732739
联系我们:
contact@tnblog.net
欢迎加群
欢迎加群交流技术