知识点
相关文章
更多最近更新
更多solr如何计算score?
2019-03-27 01:12|来源: 网路
solr计算一个query的score分为两个部分:
- Lucene的算分模型
- Boost
其中Lucene的算分模型包括:
1. tf - Term Frequency. The frequency with which a term appears in a document. Given a search query, the higher the term frequency, the higher the document score.
2. idf - Inverse Document Frequency. The rarer a term is across all documents in the index, the higher it's contribution to the score.
3. coord - Coordination Factor. The more query terms that are found in a document, the higher it's score.
coord is the coordination factor - if there are multiple terms in a query, the more terms that match, the higher the score.
4. fieldNorm - Field length. The more words that a field contains, the lower it's score. This factor penalizes documents with longer field values. In another word, matches on a smaller field score higher than matches on a larger field
Boost可以分为index-time boost和query-time boost:
Index-time boosts are applied when adding documents, and apply to the entire document or to specific fields.
Query-time boosts are applied when constructing a search query, and apply to specific fields.
转自:http://www.cnblogs.com/coldplayerest/archive/2012/06/03/2532621
相关问答
更多-
solr max得分的说明(Explanation of solr max score)[2023-06-23]
maxscore是搜索结果中最顶层文档的得分。 maxscore没有截止值,取决于Lucene / Solr完成的评分计算和标准化。 最顶层的文档将具有maxscore,而您可以从下面的文档的分数中了解它们是如何离开最顶层的。 对于评分解释,您可以查看链接 The maxscore is the scoring of the topmost document in the search results. There is no cutoff for the maxscore, and depends upo ... -
对于给定的文档,Solr可以确定有趣的术语及其权重: "interestingTerms": ["field_b:foo",5.0,"field_b:bar",2.9085307,"field_b:baz",1.67070794] 可用于生成以下搜索查询: field_b:foo^5.0 field_b:bar^2.9085307 field_b:baz^1.67070794 所以MLT是AFAIK的两个步骤,找到给定文档的有趣术语和权重,然后使用这些术语进行搜索 请参阅http://wiki ...
-
您可以尝试使用Solr提供的_val_钩子。 例如,为了按score * popularityrank进行排序,请尝试使用它 http://solr:8983/solr/select?q=hp%20laptop&_val_="product(score,popularityrank)" You can try using the _val_ hook provided by Solr. For instance, in order to sort by score * popularityrank, tr ...
-
获得Solr的相似度得分(getting similarity score in Solr)[2024-01-25]
正如您在自己的答案中提到的,您可以使用fl=*, score来指定要检索每个文档的分数的Solr。 你可以看到它阅读本文档 首先,Lucene / Solr仅提供TF-IDF (基于VSM)评分策略。 如果您决定插入第三方相似性实现,则可以更改 Solr使用的评分策略 ,但不能在查询基础上更改它。 实际上,您需要重新加载核心才能更改它。 As you mentioned in your own answer, you can specify Solr you want to retrieve the sco ... -
SOLR分数范围改变(SOLR Score Range Changed)[2022-03-12]
对于初学者来说,Solr6中的相似性更改为BM25,所以这已经是应该做的事了。 如果你想尽可能地得到类似4.x的分数,我会: 使用tdidf相似性,请参阅此处 阅读发行说明,并查看是否有其他默认设置发生了变化,对分数有一定影响。 在请求中使用调试和解释参数以获取有关如何计算结果的详细信息 for starters, similarity changed to BM25 in Solr6, so this already should be something to do. If you want to ge ... -
根据文档 ,strdist函数需要两个字符串来比较它们。 它在分析的字段上的工作方式不同。 计算两个字符串之间的距离。 使用Lucene拼写检查器StringDistance接口并支持该包中可用的所有实现,并允许应用程序通过Solr的资源加载功能插入自己的实现。 strdist需要(string1,string2,距离度量) 在尝试并阅读具有类似问题的grokbase用户之后 ,您需要在架构中添加类似title_raw的字段,请参阅下文,并重新索引。您可以尝试实现自定义SearchComponent ,它将在Solr上获得结果并在那里计算您的自定义分数。 从ResponseBuilder ( rb.getResults().docSet )中获取结果,迭代它们,将计算值添加到结果中并重新排序。 然后,您可以在RequestHandler链中将SearchComponent注册为最后一个:
elevator Solr得分未定(Solr Score undestanding)[2022-07-27]
订单不会更改查询的分数。 将debugQuery = on作为参数添加到HTTP请求中,您可以看到如何计算分数。 I opened another question and then i found the answer after hours of testing. Stackoverflow: solr-custom-similarity您可以指定要返回的最大结果数。 结果将按分数降序显示,因此您可以停止在结果集中的特定点处理。 solr/search/select?q=LOL&&start=0&rows=10&fl=*%2Cscore 有关设置最低分数的讨论,请参阅以下文章: 是否可以“合理地”设置Solr分数阈值,与返回的结果无关? (即Solr评分是否以任何方式标准化) You can specify a maximum number of results to return. The results will appear in ...您应该首先尝试对提升进行排序,然后对得分进行排序。 它应该工作并满足您的要求 You should try to first sort with respect to boost and then sort with respect to score. It should work and fulfill your requirements