fix add segment when dataset and document is empty (#3021)
Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
parent
2c43393bf1
commit
a6cd0f0e73
4 changed files with 24 additions and 2 deletions
|
|
@ -134,6 +134,11 @@ class WeaviateVector(BaseVector):
|
|||
|
||||
def text_exists(self, id: str) -> bool:
|
||||
collection_name = self._collection_name
|
||||
schema = self._default_schema(self._collection_name)
|
||||
|
||||
# check whether the index already exists
|
||||
if not self._client.schema.contains(schema):
|
||||
return False
|
||||
result = self._client.query.get(collection_name).with_additional(["id"]).with_where({
|
||||
"path": ["doc_id"],
|
||||
"operator": "Equal",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue