Elasticsearch mapping文档相似性算法
Elasticsearch allows you to configure a scoring algorithm or similarity per field. The similarity
setting provides a simple way of choosing a similarity algorithm other than the default TF/IDF, such as BM25
.
Similarities are mostly useful for text
fields, but can also apply to other field types.
Custom similarities can be configured by tuning the parameters of the built-in similarities. For more details about this expert options, see the similarity module.
The only similarities which can be used out of the box, without any further configuration are:
BM25
- The Okapi BM25 algorithm. The algorithm used by default in Elasticsearch and Lucene. See Pluggable Similarity Algorithms for more information.
classic
- The TF/IDF algorithm which used to be the default in Elasticsearch and Lucene. See Lucene’s Practical Scoring Function for more information.
The similarity
can be set on the field level when a field is first created, as follows:
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"default_field": {
"type": "text"
},
"classic_field": {
"type": "text",
"similarity": "classic"
}
}
}
}
}
The |
|
The |
参考:https://www.elastic.co/guide/en/elasticsearch/reference/current/similarity.html
最新文章
- css的三种样式
- JDBC连接sql server数据库及其它
- iOS开发中的数据安全隐患和解决方案
- 基于s5pv210嵌入式系统busybox文件系统移植
- h5拖放-拖拽购物车
- socket.io实现
- windows 2003 域控制器(AD)的常规命令行操作以及修复
- digitalocean vpn安装配置教程
- 20150817---成长日记1---DelayQueue&;&;Delayed&;&;Other
- 【笔记】移动端H5数字键盘input type=number的处理(IOS和Android)
- 记录DEV gridview获取行列数据方法
- cookie跟session自我介绍
- SQL IN 操作符
- FTP实验
- OwnCloud 开源网盘
- HDU 2255.奔小康赚大钱 最大权匹配
- com.mysql.jdbc.MysqlDataTruncation:Data Truncation:Data too long for column '字段name' at row 1
- PHP初步:在Mac OS X Yosemite下搭建Apache+PHP+Mysql
- PHP配置错误信息回报的等级
- redis系列文章