fix: generate content hash based on search space id as well.

- Allows Reindexing in selperate seatch spaces.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-06-10 13:56:23 -07:00
parent fa54de1f41
commit d8f2c5f7cf
3 changed files with 15 additions and 14 deletions

View file

@ -141,6 +141,7 @@ def convert_chunks_to_langchain_documents(chunks):
return langchain_docs
def generate_content_hash(content: str) -> str:
"""Generate SHA-256 hash for the given content."""
return hashlib.sha256(content.encode('utf-8')).hexdigest()
def generate_content_hash(content: str, search_space_id: int) -> str:
"""Generate SHA-256 hash for the given content combined with search space ID."""
combined_data = f"{search_space_id}:{content}"
return hashlib.sha256(combined_data.encode('utf-8')).hexdigest()