eldenmoon commented on code in PR #68039:
URL: https://github.com/apache/doris/pull/68039#discussion_r4026684650


##########
be/src/storage/index/inverted/similarity/bm25_similarity.cpp:
##########
@@ -41,6 +42,13 @@ BM25Similarity::BM25Similarity(float idf, float avgdl) : 
_idf(idf), _avgdl(avgdl
 }
 
 void BM25Similarity::compute_tf_cache() {
+    // CLucene keeps a field's token count in its .nrm header, so avgdl is 0 
when no segment of the
+    // field stores norms (e.g. variant subcolumn indexes). Every document 
then has an unknown length:
+    // score without length normalization instead of computing 0 / 0.
+    if (_avgdl <= 0.0F) {

Review Comment:
   throw exception



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to