the result is null when i choose rerank instead of weight #5172

Closed
opened 2026-02-21 18:09:44 -05:00 by yindo · 4 comments
Owner

Originally created by @Linnnkkk on GitHub (Aug 22, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.7.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

the result is null when i choose rerank instead of weight

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Linnnkkk on GitHub (Aug 22, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.7.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce the result is null when i choose rerank instead of weight ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🌚 invalid🤔 cant-reproduce labels 2026-02-21 18:09:44 -05:00
yindo closed this issue 2026-02-21 18:09:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 22, 2024):

@Linnnkkk Hello there! I'm here to assist you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this together!

The result is null when you choose rerank instead of weight in Dify version 0.7.1 because the rerank model calculates the semantic match between the list of candidate documents and the user query, reordering them based on semantic match. If the rerank model does not find any documents that meet the relevance criteria (e.g., due to a high score threshold or insufficiently relevant documents), it may return null.

If the TopK value is too low or the Score Threshold is too high, it might result in no documents being returned, hence the null result. Additionally, the rerank model is typically used at the final stage of the search process to merge and sort results from different retrieval systems, which might also affect the outcome if the initial retrieval did not yield sufficiently relevant documents [1][2][3][4][5].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 22, 2024): <!-- Greeting --> @Linnnkkk Hello there! I'm here to assist you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this together! <!-- Answer --> The result is null when you choose rerank instead of weight in Dify version 0.7.1 because the rerank model calculates the semantic match between the list of candidate documents and the user query, reordering them based on semantic match. If the rerank model does not find any documents that meet the relevance criteria (e.g., due to a high score threshold or insufficiently relevant documents), it may return null. If the TopK value is too low or the Score Threshold is too high, it might result in no documents being returned, hence the null result. Additionally, the rerank model is typically used at the final stage of the search process to merge and sort results from different retrieval systems, which might also affect the outcome if the initial retrieval did not yield sufficiently relevant documents <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/learn-more/extended-reading/retrieval-augment/rerank.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/knowledge-base/integrate-knowledge-within-application.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/learn-more/extended-reading/retrieval-augment/rerank.md)</sup><sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/knowledge-base/integrate-knowledge-within-application.md)</sup><sup>[[5]](https://github.com/langgenius/dify/blob/main/api/core/rag/rerank/weight_rerank.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 22, 2024):

Please describe the issue you are facing with more details. A single sentence with the same tittle and description are not helpful at all.

@crazywoola commented on GitHub (Aug 22, 2024): Please describe the issue you are facing with more details. A single sentence with the same tittle and description are not helpful at all.
Author
Owner

@Linnnkkk commented on GitHub (Aug 22, 2024):

Please describe the issue you are facing with more details. A single sentence with the same tittle and description are not helpful at all.

image

as pic shown, i adjust TopK value and Score Threshold in rerank, but return is still null, while i choose weight, it return some values to me.

@Linnnkkk commented on GitHub (Aug 22, 2024): > Please describe the issue you are facing with more details. A single sentence with the same tittle and description are not helpful at all. <img width="605" alt="image" src="https://github.com/user-attachments/assets/69ac5e2a-f219-4dbe-9612-1547b83890fa"> as pic shown, i adjust TopK value and Score Threshold in rerank, but return is still null, while i choose weight, it return some values to me.
Author
Owner

@crazywoola commented on GitHub (Sep 23, 2024):

Fixed in v0.8.x

@crazywoola commented on GitHub (Sep 23, 2024): Fixed in v0.8.x
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5172