Skip to content

Commit

Permalink
Case insensitive when set doc engine (infiniflow#3954)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

DOC_ENGINE="INFINITY" or "Infinity" or "Elasticsearch" also works

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
  • Loading branch information
JinHai-CN authored Dec 10, 2024
1 parent 927873b commit 7d4f1c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ def init_settings():

global DOC_ENGINE, docStoreConn, retrievaler, kg_retrievaler
DOC_ENGINE = os.environ.get('DOC_ENGINE', "elasticsearch")
if DOC_ENGINE == "elasticsearch":
lower_case_doc_engine = DOC_ENGINE.lower()
if lower_case_doc_engine == "elasticsearch":
docStoreConn = rag.utils.es_conn.ESConnection()
elif DOC_ENGINE == "infinity":
elif lower_case_doc_engine == "infinity":
docStoreConn = rag.utils.infinity_conn.InfinityConnection()
else:
raise Exception(f"Not supported doc engine: {DOC_ENGINE}")
Expand Down

0 comments on commit 7d4f1c0

Please sign in to comment.