我刚打酱油去了,不好意思

如何使用自定义的 Similarity插件

Elasticsearch | 作者 smile_sunshine | 发布于2016年03月23日 | 阅读数:5829

在ES中扩展了自己的Similarity插件,我想在搜索的时候使用自己的Similarity插件,不使用BM25的那个,但是怎么去用捏?貌似没找到相关的资料,我使用的是Elasticsearch.net+Nest,期待各位大侠的指点....
已邀请:

helloes

赞同来自:

1、可以在elasticsearch.yml指定默认的similarity
index.similarity.default.type: my_similarity


2、在mapping中指定
PUT /my_index
{
"mappings": {
"doc": {
"properties": {
"title": {
"type": "string",
"similarity": "my_similarity"
},
"body": {
"type": "string",
"similarity": "default"
}
}
}
}
参考:https://www.elastic.co/guide/e ... .html

smile_sunshine

赞同来自:

嗯,谢谢你的回答,我这个其实是自己的.NET的版本需求, GitHub上也给出解决方法,如果有兴趣https://github.com/elastic/ela ... /1946

要回复问题请先登录注册