diff --git a/memoryscope/storage/llama_index_es_memory_store.py b/memoryscope/storage/llama_index_es_memory_store.py index 22d43dd7..63fb0cd3 100644 --- a/memoryscope/storage/llama_index_es_memory_store.py +++ b/memoryscope/storage/llama_index_es_memory_store.py @@ -27,7 +27,8 @@ class LlamaIndexEsMemoryStore(BaseMemoryStore): retrieval_strategy = ESCombinedRetrieveStrategy(retrieve_mode=retrieve_mode, hybrid_alpha=hybrid_alpha) self.es_store = SyncElasticsearchStore(index_name=index_name, es_url=es_url, - retrieval_strategy=retrieval_strategy, + retrieval_strategy=ESCombinedRetrieveStrategy(retrieve_mode=retrieve_mode, + hybrid_alpha=hybrid_alpha), **kwargs) # TODO The llamaIndex utilizes some deprecated functions, hence langchain logs warning messages. By diff --git a/memoryscope/storage/llama_index_sync_elasticsearch.py b/memoryscope/storage/llama_index_sync_elasticsearch.py index 4bfa2de4..4786dad9 100644 --- a/memoryscope/storage/llama_index_sync_elasticsearch.py +++ b/memoryscope/storage/llama_index_sync_elasticsearch.py @@ -267,7 +267,7 @@ def _to_elasticsearch_filter(standard_filters: Dict[str, List[str]]) -> Dict[str } } ) - result['bool'].update({"should": operands}) # ⭐ Add 'should' clause for OR logic + result['bool'].update({"should": operands}) # тнР Add 'should' clause for OR logic result['bool'].update({"minimum_should_match": 1}) # Ensure at least one 'should' match else: key_str = f"metadata.{key}.keyword" if isinstance(value, str) else f"metadata.{key}"