diff --git a/lightrag/kg/milvus_impl.py b/lightrag/kg/milvus_impl.py index faf0a485..8a13fd21 100644 --- a/lightrag/kg/milvus_impl.py +++ b/lightrag/kg/milvus_impl.py @@ -44,12 +44,6 @@ class MilvusVectorDBStorage(BaseVectorStorage): max_length=512, nullable=True, ), - FieldSchema( - name="entity_type", - dtype=DataType.VARCHAR, - max_length=128, - nullable=True, - ), FieldSchema( name="file_path", dtype=DataType.VARCHAR, @@ -67,7 +61,6 @@ class MilvusVectorDBStorage(BaseVectorStorage): FieldSchema( name="tgt_id", dtype=DataType.VARCHAR, max_length=512, nullable=True ), - FieldSchema(name="weight", dtype=DataType.DOUBLE, nullable=True), FieldSchema( name="file_path", dtype=DataType.VARCHAR, @@ -227,19 +220,6 @@ class MilvusVectorDBStorage(BaseVectorStorage): logger.debug(f"IndexParams method failed for entity_name: {e}") self._create_scalar_index_fallback("entity_name", "INVERTED") - try: - entity_type_index = self._get_index_params() - entity_type_index.add_index( - field_name="entity_type", index_type="INVERTED" - ) - self._client.create_index( - collection_name=self.namespace, - index_params=entity_type_index, - ) - except Exception as e: - logger.debug(f"IndexParams method failed for entity_type: {e}") - self._create_scalar_index_fallback("entity_type", "INVERTED") - elif "relationships" in self.namespace.lower(): # Create indexes for relationship fields try: @@ -294,7 +274,6 @@ class MilvusVectorDBStorage(BaseVectorStorage): # Create scalar indexes using fallback if "entities" in self.namespace.lower(): self._create_scalar_index_fallback("entity_name", "INVERTED") - self._create_scalar_index_fallback("entity_type", "INVERTED") elif "relationships" in self.namespace.lower(): self._create_scalar_index_fallback("src_id", "INVERTED") self._create_scalar_index_fallback("tgt_id", "INVERTED") @@ -320,14 +299,12 @@ class MilvusVectorDBStorage(BaseVectorStorage): if "entities" in self.namespace.lower(): specific_fields = { "entity_name": {"type": "VarChar"}, - "entity_type": {"type": "VarChar"}, "file_path": {"type": "VarChar"}, } elif "relationships" in self.namespace.lower(): specific_fields = { "src_id": {"type": "VarChar"}, "tgt_id": {"type": "VarChar"}, - "weight": {"type": "Double"}, "file_path": {"type": "VarChar"}, } elif "chunks" in self.namespace.lower():