elasticsearch 自定义打分

curl -XGET ‘http://localhost:9200/searchsuggestion/searchsuggestion/_search?pretty‘ -d ‘{

"fields" : ["company_full_name","id"],

"size" : 10,

"query": {

"function_score": {

"functions": [

{

"filter": { "term": { "pinyin_name": "bx" } },

"weight": 100

},

{

"filter": { "term": { "blurry": "bx" } },

"weight": 10

},

{

"field_value_factor" : {

"field" : "frequency",

"factor" : 0.1,

"modifier" : "ln"

}

}

],

"score_mode": "sum"

}

}

}‘

解释

score=pinyin_name*100+blurry*10+ln(0.1*frequency)

时间: 2024-10-12 23:59:58

elasticsearch 自定义打分的相关文章

elasticsearch 自定义_id

elasticsearch 自定义ID: curl -s -XPUT localhost:9200/web -d ' { "mappings": { "blog": { "_id": { "path": "uuid" }, "properties": { "title": { "type": "string", "in

elasticsearch 自定义similarity 插件开发

原文  http://www.cnblogs.com/luanfei/p/4029442.html 主题 Elastic Search 转自: http://www.chepoo.com/elasticsearch-similarity-custom-plug-in-development.html 在搜索开发中,我们要修改打分机制,就需要自定义similarity.现在来简单说一下elasticsearch下的自定义similarity 插件开发. 网上的 https://github.com

ElasticSearch自定义分析器-集成结巴分词插件

关于结巴分词 ElasticSearch 插件: https://github.com/huaban/elasticsearch-analysis-jieba 该插件由huaban开发.支持Elastic Search 版本<=2.3.5. 结巴分词分析器 结巴分词插件提供3个分析器:jieba_index.jieba_search和jieba_other. jieba_index: 用于索引分词,分词粒度较细: jieba_search: 用于查询分词,分词粒度较粗: jieba_other:

Elasticsearch function_score 打分源代码跟踪

类注册器 IndicesModule private void registerBuiltinQueryParsers() { registerQueryParser(MatchQueryParser.class); registerQueryParser(MultiMatchQueryParser.class); registerQueryParser(NestedQueryParser.class); registerQueryParser(HasChildQueryParser.class

Elasticsearch 自定义多个分析器

分析器(Analyzer) Elasticsearch 无论是内置分析器还是自定义分析器,都由三部分组成:字符过滤器(Character Filters).分词器(Tokenizer).词元过滤器(Token Filters). 分析器Analyzer工作流程: Input Text => Character Filters(如果有多个,按顺序应用) => Tokenizer => Token Filters(如果有多个,按顺序应用) => Output Token 字符过滤器(C

elasticsearch相关性打分背后的理论

说明:elasticsearch查询结果是根据什么排序的呢?答案是根据相关性得分的高低来排序,本篇着重说明elasticsearch打分机制背后的理论. 主要是翻译自elasticsearch官方文档,官方文档地址如下: 相关性打分背后的理论:https://www.elastic.co/guide/en/elasticsearch/guide/current/scoring-theory.html 相关性打分权重修正图解:https://www.elastic.co/guide/en/elas

ElasticSearch——自定义模板

output中配置 elasticsearch{ action => "index" hosts => ["xxx"] index => "http-log-logstash" document_type => "logs" template => "opt/http-logstash.json" template_name => "http-log-logst

Elasticsearch自定义脚本完成性能测试

1.ES性能测试 要求: 1)完成ES并发100次性能测试: 2)统计得出访问时间结果值. 2.脚本实现 #!/bin/sh KEYWORDS_TXT="./keywords.txt" cat /dev/null > ./rst.txt echo "beginTime=`date`" cat $KEYWORDS_TXT | while read line do echo "line=$line" echo "curl -XGET

filebrat6.8多路径日志输出到elasticsearch自定义多个索引

原文地址:https://blog.51cto.com/12102819/2481956