-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: Update full-text index name to include workspace label for bett… #2406
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
base: main
Are you sure you want to change the base?
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ): | ||
| """Create a full-text index on the entity_id property with Chinese tokenizer support.""" | ||
| index_name = "entity_id_fulltext_idx" | ||
| index_name = f"entity_id_fulltext_idx_{workspace_label}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full-text search uses stale index name
The full-text index is now created as entity_id_fulltext_idx_{workspace_label}, but search_labels still calls db.index.fulltext.queryNodes with the hard-coded name entity_id_fulltext_idx (see around line 1644), so on any newly created workspace where only the workspace-specific index exists, queries will throw IndexNotFound and always fall back to the slower CONTAINS-based path. The new index is never used, negating the change and degrading search performance for new databases.
Useful? React with 👍 / 👎.
|
After renaming the index, data migration must also be considered to ensure that indexes in legacy systems are properly updated to the new name. |
Co-authored-by: netbrah <[email protected]>
Co-authored-by: netbrah <[email protected]>
This pull request makes a small but important change to the naming convention for full-text indexes in the Neo4j implementation. The index name now includes the
workspace_label, ensuring that each workspace has a uniquely named index and preventing potential naming conflicts.index_namein the_create_fulltext_indexmethod oflightrag/kg/neo4j_impl.pynow incorporates theworkspace_label, making the index name workspace-specific.Description
[Briefly describe the changes made in this pull request.]
Related Issues
[Reference any related issues or tasks addressed by this pull request.]
Changes Made
[List the specific changes made in this pull request.]
Checklist
Additional Notes
[Add any additional notes or context for the reviewer(s).]