diff --git a/docs/references/http_api_reference.md b/docs/references/http_api_reference.md index 7af9d4bdf..f2b86a735 100644 --- a/docs/references/http_api_reference.md +++ b/docs/references/http_api_reference.md @@ -1840,7 +1840,7 @@ Retrieves chunks from specified datasets. - `"highlight"`: `boolean` - `"cross_languages"`: `list[string]` - `"metadata_condition"`: `object` - + - `"use_kg"`: `boolean` ##### Request example ```bash @@ -1888,6 +1888,8 @@ curl --request POST \ The weight of vector cosine similarity. Defaults to `0.3`. If x represents the weight of vector cosine similarity, then (1 - x) is the term similarity weight. - `"top_k"`: (*Body parameter*), `integer` The number of chunks engaged in vector cosine computation. Defaults to `1024`. +- `"use_kg"`: (*Body parameter*), `boolean` + The search includes text chunks related to the knowledge graph of the selected dataset to handle complex multi-hop queries. Defaults to `False`. - `"rerank_id"`: (*Body parameter*), `integer` The ID of the rerank model. - `"keyword"`: (*Body parameter*), `boolean` diff --git a/rag/nlp/search.py b/rag/nlp/search.py index 09c1324d3..1bf0abe04 100644 --- a/rag/nlp/search.py +++ b/rag/nlp/search.py @@ -384,7 +384,7 @@ class Dealer: rank_feature=rank_feature) else: lower_case_doc_engine = os.getenv('DOC_ENGINE', 'elasticsearch') - if lower_case_doc_engine == "elasticsearch": + if lower_case_doc_engine in ["elasticsearch","opensearch"]: # ElasticSearch doesn't normalize each way score before fusion. sim, tsim, vsim = self.rerank( sres, question, 1 - vector_similarity_weight, vector_similarity_weight,