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: selecting search all doesnt work #627

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

varunsharma27
Copy link
Contributor

@varunsharma27 varunsharma27 commented Jan 13, 2025

Description

Further info on the bug (#561):

Each time you upload files, will create a unique id, then create a folder by id, and store light rag data in this folder.

Drag & Drop each file separately to LightRag file collection causes them to be separated

  1. Two separate indexes are created under ktem_app_data\user_data\files\lightrag\
  2. Query will only search against one index at a time even if both files are selected. And "Search All" button doesn't work. It will complaint no documents are selected.
  3. When selecting multiple files in the drop down, only the first one selected will be included in the search. The others will be ignored.

Drag & Drop both (all) files at the same time to be indexed

  1. One index is created under ktem_app_data\user_data\files\lightrag\
  2. Query will search both documents
  3. Query will search both documents EVEN if I only selected one file in the drop down.

Solution

Adding new documents should update the existing index within the file collection instead of creating new one. Which is implemented in this PR.

Type of change

  • New features (non-breaking change).
  • Bug fix (non-breaking change).
  • Breaking change (fix or feature that would cause existing functionality not to work as expected).

Checklist

  • I have performed a self-review of my code.
  • I have added thorough tests if it is a core feature.
  • There is a reference to the original bug report and related work.
  • I have commented on my code, particularly in hard-to-understand areas.
  • The feature is well documented.

@varunsharma27 varunsharma27 changed the title fix: select all doesnt work fix: selecting search all doesnt work Jan 13, 2025
@Silverls96
Copy link

Silverls96 commented Jan 17, 2025

assert (
            len(self.file_ids) <= 1
        ), "GraphRAG retriever only supports one file_id at a time"

        file_id = self.file_ids[0]
    I wonder is it because of this?

@varunsharma27
Copy link
Contributor Author

@Silverls96 Thats interesting, this error is only present in the GraphRAG whereas LightRAG just picks the first file of the bunch.

I think it's because of lack of incremental graph updates in GraphRAG so the file collection can be disjoint in terms of graphs.

@Silverls96
Copy link

@varunsharma27 yeah. I think we need to have an option certain group "A" of files will update index when new files added or something alike. We don't always use the same index. It will be nice to have that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Selecting 'Search All' doesn't work. [BUG] LightRAG file selection
2 participants