diff --git a/libs/milvus/langchain_milvus/retrievers/milvus_hybrid_search.py b/libs/milvus/langchain_milvus/retrievers/milvus_hybrid_search.py index b05198f..12152cd 100644 --- a/libs/milvus/langchain_milvus/retrievers/milvus_hybrid_search.py +++ b/libs/milvus/langchain_milvus/retrievers/milvus_hybrid_search.py @@ -96,9 +96,10 @@ def _validate_fields_name(self) -> None: self.text_field in collection_fields ), f"{self.text_field} is not a valid field in the collection." for field in self.output_fields: # type: ignore[union-attr] - assert ( - field in collection_fields - ), f"{field} is not a valid field in the collection." + if not self.collection.schema.enable_dynamic_field: + assert ( + field in collection_fields + ), f"{field} is not a valid field in the collection." def _get_output_fields(self) -> List[str]: if self.output_fields: