13.multi_match实现dis_max+tie_breaker
主要知识点:
- 基于multi_match语法实现dis_max+tie_breaker
1、best_fields+tie_breaker
GET /forum/article/_search
{
"query": {
"multi_match": {
"query": "java solution",
"type":"best_fields",
"fields":[ "title^2", "content" ],
"tie_breaker": 0.3,
"minimum_should_match": "50%"
}
}
}
"fields":[ "title^2", "content" ],把title的权重设为2
二、multi_match实现dis_max+tie_breaker
GET /forum/article/_search
{
"query": {
"dis_max": {
"tie_breaker": 0.7,
"queries": [{"match": {"title":
{"query": "java beginer","boost":2,"minimum_should_match": "50%"}}},
{"match": {"content":
{"query": "java beginer","boost":1,"minimum_should_match": "30%"}}}
]
}
}
}
minimum_should_match,主要是用来去长尾(long tail),什么是长尾?,比如你搜索5个关键词,但是很多结果是只匹配1个关键词的,其实跟你想要的结果相差甚远,这些结果就是长尾。
minimum_should_match,控制搜索结果的精准度,只有匹配一定数量的关键词的数据,才能返回。
13.multi_match实现dis_max+tie_breaker的更多相关文章
- 11.best fields策略(dis_max参数设置)
主要知识点 常规multi-field搜索结果分析 dis_max参数设置 一.为帖子数据增加content字段 POST /forum/article/_bulk { "u ...
- ES进阶--02
第11节深度探秘搜索技术_案例实战基于dis_max实现best fields策略进行多字段搜索 课程大纲 1.为帖子数据增加content字段 POST /forum/article/_bulk{ ...
- 白日梦的Elasticsearch实战笔记,ES账号免费借用、32个查询案例、15个聚合案例、7个查询优化技巧。
目录 一.导读 二.福利:账号借用 三._search api 搜索api 3.1.什么是query string search? 3.2.什么是query dsl? 3.3.干货!32个查询案例! ...
- 白日梦的Elasticsearch实战笔记,32个查询案例、15个聚合案例、7个查询优化技巧。
目录 一.导读 三._search api 搜索api 3.1.什么是query string search? 3.2.什么是query dsl? 3.3.干货!32个查询案例! 四.聚合分析 4.1 ...
- Elasticsearch学习笔记(十四)relevance score相关性评分的计算(1)
一.多shard场景下relevance score不准确问题 1.问题描述: 多个shard下,如果每个shard包含指定搜索条件的document数量不均匀的情况下, ...
- Elasticsearch 知识点整理 一
极力推荐: 官网地址: https://www.elastic.co/guide/en/elasticsearch/reference/6.0 肺腑之言,学ES先学原生的语法,SpringData封装 ...
- elasticsearch 搜索提示DSL
1,创建mapping: PUT /news_website { "mappings": { "news" : { "properties" ...
- elasticsearch relevance score相关性评分的计算
一.多shard场景下relevance score不准确问题 1.问题描述: 多个shard下,如果每个shard包含指定搜索条件的document数量不均匀的情况下,会导致在某个shard上doc ...
- 白日梦的ES笔记三:万字长文 Elasticsearch基础概念统一扫盲
目录 一.导读 二.彩蛋福利:账号借用 三.ES的Index.Shard及扩容机制 四.ES支持的核心数据类型 4.1.数字类型 4.2.日期类型 4.3.boolean类型 4.4.二进制类型 4. ...
随机推荐
- hdu5371 最长回文子串变形(Manacher算法)
pid=5371">http://acm.hdu.edu.cn/showproblem.php? pid=5371 Problem Description Hotaru Ichijou ...
- luogu 3834 【模板】可持久化线段树 1(主席树)
我这种菜鸡还是%一下棒神比较好 #include<iostream> #include<cstdio> #include<cmath> #include<cs ...
- 懒人学习automake, Makefile.am,configure.ac
已经存在Makefile.am,如何生成Makefile? 步骤: [root@localhost hello]# autoscan .///在当前文件夹中搜索 [root@localhost hel ...
- residual sum of squares(ESL 读书笔记)
The learning algorithm has the property that it can modify its input/output relationship f-hat in re ...
- Spark SQL中 RDD 转换到 DataFrame
1.people.txtsoyo8, 35小周, 30小华, 19soyo,882./** * Created by soyo on 17-10-10. * 利用反射机制推断RDD模式 */impor ...
- Ansi2Utf8 小工具
将GB2312编码的文件转成Unity使用的UTF8无bom格式 主要用批处理执行 Ansi2Utf8.exe XXXXX.txt 源代码 using System; using System.Co ...
- 9.12NOIP模拟题
NOIP 2017 全假模拟冲刺 hkd 题目名称 Spfa 走楼梯缩小版 滑稽 题目类型 传统 传统 传统 ...
- AcWing算法基础1.4
高精度 高精度加法,高精度减法,高精度乘低精度,高精度除以低精度,大概平时用的最多的就是这四个,模板有两种(因为我现在不太会用vector,就用数组也写了个,23333) 高精度运算和人工手算差不多, ...
- 【Codeforces1117C_CF1117C】Magic Ship(构造)
题目: Codeforces1117C 考的时候很困,开局半小时后才过A,只做出来AB,排名3000+,掉了119--半夜体验极差. 翻译: 你是一个船长.最初你在点 \((x_1,y_1)\) (显 ...
- 【USACO2009 Open】滑雪课程ski
[USACO2009 Open]滑雪课程 Ski Lessons Time Limit: 1000 ms Memory Limit: 131072 KBytes Description 约翰请贝西去科 ...