Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(milvus): Fix milvus store search with topk always set to 4 #2131

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

slper001
Copy link
Contributor

Description

Previously, the search topk in Milvus storage was always fixed at 4. This commit fixes the issue by allowing users to specify topk dynamically.

How Has This Been Tested?

When the parameter VECTOR_STORE_TYPE is set to Milvus, the KNOWLEDGE_SEARCH_TOP_SIZE parameter becomes ineffective, and the system can only match up to 4 documents from the Milvus database. The issue lies in the _search method of the MilvusStore class, where the letter k represents the meaning of topk and is set to a default value of 4. However, during the method call, the keyword argument passed is topk (instead of k), causing the parameter to be ignored and the value of k to remain fixed at the default value of 4.

After I modified the keyword argument passed during the method call, the KNOWLEDGE_SEARCH_TOP_SIZE parameter started working as expected.

Snapshots:

Include snapshots for easier review.

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

Previously, the search topk in Milvus storage was always fixed at 4.
This commit fixes the issue by allowing users to specify topk dynamically.
@github-actions github-actions bot added the fix Bug fixes label Nov 17, 2024
Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, LGTM.

Copy link
Collaborator

@yhjun1026 yhjun1026 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

@Aries-ckt Aries-ckt merged commit 2decf02 into eosphoros-ai:main Nov 18, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants