mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-10 22:34:39 +00:00
fix: generate content hash based on search space id as well.
- Allows Reindexing in selperate seatch spaces.
This commit is contained in:
parent
fa54de1f41
commit
d8f2c5f7cf
3 changed files with 15 additions and 14 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue