简体   繁体   English

配置弹性搜索结果评分

[英]Configure Elastic Search Result Scoring

Is it possible to configure or otherwise alter how Elastic Search scores its results? 是否可以配置或以其他方式更改Elastic Search对结果进行评分的方式?

When running a search for "term" using the NativeSearchQueryBuilder documents that contain one instance of the term are all scored the same. 使用NativeSearchQueryBuilder文档运行包含“词条”实例的“词条”搜索时,其得分均相同。 This makes sense. 这是有道理的。 However one of the documents contain just the term, where are the others contain term and other data. 但是,其中一个文档仅包含术语,而其他文档则包含术语和其他数据。 For example; 例如;

Doc1: Title : Space Doc1:标题:空格

Doc2: Title : Space Time Doc2:标题:时空

Doc3: Title : No Space Doc3:标题:无空格

So when searching for Space is there anyway to make Doc1 score more highly? 因此,当搜索Space时,Doc1得分会更高吗?

-Edit So, a little more detail following briarheart's response. -编辑因此,在briarheart的回应之后,再详细一点。 I think the problem is the way we're implementing typeahead searches. 我认为问题在于我们实施预搜索的方式。 If I run the Space query using our standard search the ranking is as outlined by briarheart, but our typeahead scores everything equally because we are using the wildcard request part and looking for "term*" so "Space" and "Space Lane" do both match that equally well. 如果我使用标准搜索来运行Space查询,那么排名将如briarheart所概述的那样,但由于我们正在使用通配符请求部分并查找“ term *”,因此我们的typeahead会对所有内容均进行评分,因此“ Space”和“ Space Lane”都可以匹配得同样好。

So really I guess I'm asking the wrong question. 所以真的我想我问错了问题。 Scoring is working as it should, I just need to figure out a better implementation of type ahead. 计分正在按计划进行,我只需要弄清楚类型的更好实现即可。

(The Suggest Request Part doesn't seem to fit the use case as this would involve picking and resubmitting the desired suggestion). (建议请求部分似乎不适合用例,因为这将涉及选择并重新提交所需的建议)。

I do not know how exactly does look like your query but actually in case of using full text search of the term "Space" the document "Doc1" from your example will get the highest score because of length of its "Title" field. 我不知道查询的外观如何,但是实际上,在对术语“空格”进行全文搜索的情况下,示例中的文档“ Doc1”由于其“标题”字段的长度而将获得最高分。 Shorter fields have more weight in terms of relevance. 就相关性而言,较短的字段具有更大的权重。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM