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

Elasticsearch mapping文档相似性算法的更多相关文章

  1. elasticsearch 路由文档到分片

    路由文档到分片 当你索引一个文档,它被存储在单独一个主分片上.Elasticsearch是如何知道文档属于哪个分片的呢?当你创建一个新文档,它是如何知道是应该存储在分片1还是分片2上的呢? 进程不能是 ...

  2. ElasticSearch——原始文档和倒排索引

    一.原始文档 如上图所示, 第二象限是一份原始文档,有title和content2个字段,字段取值分别为”我是中国人”和” 热爱共X产党”,这一点没什么可解释的.我们把原始文档写入Elasticsea ...

  3. elasticsearch父子文档处理(join)

    elasticsearch父子文档处理 join 一.背景 二.需求 三.前置知识 四.实现步骤 1.创建 mapping 2.添加父文档数据 3.添加子文档 4.查询文档 1.根据父文档id查询它下 ...

  4. 相似文档查找算法之 simHash 简介及其 java 实现 - leejun_2005的个人页面 - 开源中国社区

    相似文档查找算法之 simHash 简介及其 java 实现 - leejun_2005的个人页面 - 开源中国社区 相似文档查找算法之 simHash 简介及其 java 实现

  5. ElasticSearch部署文档(Ubuntu 14.04)

    ElasticSearch部署文档(Ubuntu 14.04) 参考链接 https://www.elastic.co/guide/en/elasticsearch/guide/current/hea ...

  6. 007-elasticsearch5.4.3【一】概述、Elasticsearch 访问方式、Elasticsearch 面向文档、常用概念

    一.概述 Elasticsearch 是一个开源的搜索引擎,建立在一个全文搜索引擎库 Apache Lucene™ 基础之上. Elasticsearch 也是使用 Java 编写的,它的内部使用 L ...

  7. Elasticsearch 删除文档

    章节 Elasticsearch 基本概念 Elasticsearch 安装 Elasticsearch 使用集群 Elasticsearch 健康检查 Elasticsearch 列出索引 Elas ...

  8. Elasticsearch 更新文档

    章节 Elasticsearch 基本概念 Elasticsearch 安装 Elasticsearch 使用集群 Elasticsearch 健康检查 Elasticsearch 列出索引 Elas ...

  9. .Net Api 之如何使用Elasticsearch存储文档

    .Net Api 之如何使用Elasticsearch存储文档 什么是Elasticsearch? Elasticsearch 是一个分布式.高扩展.高实时的搜索与数据分析引擎.它能很方便的使大量数据 ...

随机推荐

  1. Vue2.0 引用 exif.js 实现调用摄像头进行拍照功能以及图片上传功能

    vue组件代码 <template> <div> <div style="padding:20px;"> <div class=" ...

  2. openssl之BIO系列之22---Cipher类型的BIO

    Cipher类型BIO ---依据openssl doc\crypto\bio_f_cipher.pod翻译和自己的理解写成 (作者:DragonKing, Mail: wzhah@263.net , ...

  3. 【Excle数据透视表】如何显示/隐藏数据透视表字段列表

    在创建完毕的数据透视表中,若单击数据透视表中任意单元格,即可显示数据透视表字段列表窗格,用户就可以通过弹出的窗格进行字段调整 两种情况需要隐藏数据数据透视表窗格 ①数据透视表已经完成 ②失误关闭窗格 ...

  4. vs2010 assistx安装教程

    参照此篇教程. 安装目录你可能找不到,因为那些文件是系统隐藏文件,打开隐藏即可. 然后,将此.exe安装到上面的目录下,然后,还需要进行一个破解,即需要将从网上下载的补丁放进去. 把目录下的VA_X. ...

  5. 多系统启动光盘制作---WIN7+WinXP+老毛桃PE工具箱

    1.工具: ⑴ Windows 7 ISO: ⑵ Windows XP ISO: ⑶ 老毛桃U盘启动盘制作工具V2013 制作得的ISO (含PE.DOS等): ⑷ UltraISO.EasyBoot ...

  6. Web安全系列(四):XSS 的防御

    简介 XSS 的防御很复杂,并不是一套防御机制就能就解决的问题,它需要具体业务具体实现. 目前来说,流行的浏览器内都内置了一些 XSS 过滤器,但是这只能防御一部分常见的 XSS,而对于网站来说,也应 ...

  7. android:scrollbar的一些属性

    1. activity_maim.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android ...

  8. 优志愿前端数据加密破解-python

    # coding=utf-8 import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "etiaky.sett ...

  9. 添加w3c验证图片到网站

    1.在http://validator.w3.org/网站验证 2.添加验证通过后的代码至自己的网站 类似<p>    <a href="http://validator. ...

  10. 使用Excel2007去反复功能时要注意的一个问题

    作者:iamlaosong Excel2007有个去反复功能(菜单:数据----删除反复项).非常实用,过去须要用VBA编程实现的功能,如今点击一下图标即可了.去反复通常是指定某列或者某几列.依据这指 ...