gzdaniel commited on
Commit
a0b01c7
·
2 Parent(s): 7b700ba 742f6a5

Merge branch 'fix-milvus' into milvus-for-nullable

Browse files
Files changed (1) hide show
  1. lightrag/kg/milvus_impl.py +0 -16
lightrag/kg/milvus_impl.py CHANGED
@@ -220,19 +220,6 @@ class MilvusVectorDBStorage(BaseVectorStorage):
220
  logger.debug(f"IndexParams method failed for entity_name: {e}")
221
  self._create_scalar_index_fallback("entity_name", "INVERTED")
222
 
223
- try:
224
- entity_type_index = self._get_index_params()
225
- entity_type_index.add_index(
226
- field_name="entity_type", index_type="INVERTED"
227
- )
228
- self._client.create_index(
229
- collection_name=self.namespace,
230
- index_params=entity_type_index,
231
- )
232
- except Exception as e:
233
- logger.debug(f"IndexParams method failed for entity_type: {e}")
234
- self._create_scalar_index_fallback("entity_type", "INVERTED")
235
-
236
  elif "relationships" in self.namespace.lower():
237
  # Create indexes for relationship fields
238
  try:
@@ -287,7 +274,6 @@ class MilvusVectorDBStorage(BaseVectorStorage):
287
  # Create scalar indexes using fallback
288
  if "entities" in self.namespace.lower():
289
  self._create_scalar_index_fallback("entity_name", "INVERTED")
290
- self._create_scalar_index_fallback("entity_type", "INVERTED")
291
  elif "relationships" in self.namespace.lower():
292
  self._create_scalar_index_fallback("src_id", "INVERTED")
293
  self._create_scalar_index_fallback("tgt_id", "INVERTED")
@@ -313,14 +299,12 @@ class MilvusVectorDBStorage(BaseVectorStorage):
313
  if "entities" in self.namespace.lower():
314
  specific_fields = {
315
  "entity_name": {"type": "VarChar"},
316
- "entity_type": {"type": "VarChar"},
317
  "file_path": {"type": "VarChar"},
318
  }
319
  elif "relationships" in self.namespace.lower():
320
  specific_fields = {
321
  "src_id": {"type": "VarChar"},
322
  "tgt_id": {"type": "VarChar"},
323
- "weight": {"type": "Double"},
324
  "file_path": {"type": "VarChar"},
325
  }
326
  elif "chunks" in self.namespace.lower():
 
220
  logger.debug(f"IndexParams method failed for entity_name: {e}")
221
  self._create_scalar_index_fallback("entity_name", "INVERTED")
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  elif "relationships" in self.namespace.lower():
224
  # Create indexes for relationship fields
225
  try:
 
274
  # Create scalar indexes using fallback
275
  if "entities" in self.namespace.lower():
276
  self._create_scalar_index_fallback("entity_name", "INVERTED")
 
277
  elif "relationships" in self.namespace.lower():
278
  self._create_scalar_index_fallback("src_id", "INVERTED")
279
  self._create_scalar_index_fallback("tgt_id", "INVERTED")
 
299
  if "entities" in self.namespace.lower():
300
  specific_fields = {
301
  "entity_name": {"type": "VarChar"},
 
302
  "file_path": {"type": "VarChar"},
303
  }
304
  elif "relationships" in self.namespace.lower():
305
  specific_fields = {
306
  "src_id": {"type": "VarChar"},
307
  "tgt_id": {"type": "VarChar"},
 
308
  "file_path": {"type": "VarChar"},
309
  }
310
  elif "chunks" in self.namespace.lower():