Skip to content

Conversation

@netbrah
Copy link

@netbrah netbrah commented Nov 22, 2025

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.

  • The index_name in the _create_fulltext_index method of lightrag/kg/neo4j_impl.py now incorporates the workspace_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

  • Changes tested locally
  • Code reviewed
  • Documentation updated (if necessary)
  • Unit tests added (if applicable)

Additional Notes

[Add any additional notes or context for the reviewer(s).]

@danielaskdd
Copy link
Collaborator

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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}"

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@danielaskdd
Copy link
Collaborator

After renaming the index, data migration must also be considered to ensure that indexes in legacy systems are properly updated to the new name.

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.

2 participants