Elasticsearch allows you to configure a scoring algorithm or similarity per field. The similaritysetting 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 default_field uses the BM25 similarity.

The classic_field uses the classic similarity (ie TF/IDF).

参考:https://www.elastic.co/guide/en/elasticsearch/reference/current/similarity.html

最新文章

  1. css的三种样式
  2. JDBC连接sql server数据库及其它
  3. iOS开发中的数据安全隐患和解决方案
  4. 基于s5pv210嵌入式系统busybox文件系统移植
  5. h5拖放-拖拽购物车
  6. socket.io实现
  7. windows 2003 域控制器(AD)的常规命令行操作以及修复
  8. digitalocean vpn安装配置教程
  9. 20150817---成长日记1---DelayQueue&&Delayed&&Other
  10. 【笔记】移动端H5数字键盘input type=number的处理(IOS和Android)
  11. 记录DEV gridview获取行列数据方法
  12. cookie跟session自我介绍
  13. SQL IN 操作符
  14. FTP实验
  15. OwnCloud 开源网盘
  16. HDU 2255.奔小康赚大钱 最大权匹配
  17. com.mysql.jdbc.MysqlDataTruncation:Data Truncation:Data too long for column '字段name' at row 1
  18. PHP初步:在Mac OS X Yosemite下搭建Apache+PHP+Mysql
  19. PHP配置错误信息回报的等级
  20. redis系列文章

热门文章

  1. UNP学习笔记(第十一章 名字与地址转换)
  2. OpenTSDB设计解读
  3. c#中使用ABCpdf处理PDF,so easy
  4. 修改Oracle SGA,以提高oracle性能
  5. robotframework安装appium
  6. Java多线程下载文件
  7. HP Vertica Analytics Platform 评測
  8. 搜狐新闻APP是如何使用HUAWEI DevEco IDE快速集成HUAWEI HiAI Engine
  9. Ejabberd作为推送服务的优化手段(转)
  10. 在linux系统中I/O 调度的选择 (转)