Kevin Hu
commited on
Commit
·
a8c4af8
1
Parent(s):
afb702e
Code format. (#4611)
Browse files### What problem does this PR solve?
### Type of change
- [x] Refactoring
- rag/utils/es_conn.py +2 -3
rag/utils/es_conn.py
CHANGED
@@ -28,7 +28,6 @@ from rag import settings
|
|
28 |
from rag.settings import TAG_FLD, PAGERANK_FLD
|
29 |
from rag.utils import singleton
|
30 |
from api.utils.file_utils import get_project_base_directory
|
31 |
-
import polars as pl
|
32 |
from rag.utils.doc_store_conn import DocStoreConnection, MatchExpr, OrderByExpr, MatchTextExpr, MatchDenseExpr, \
|
33 |
FusionExpr
|
34 |
from rag.nlp import is_english, rag_tokenizer
|
@@ -142,7 +141,7 @@ class ESConnection(DocStoreConnection):
|
|
142 |
knowledgebaseIds: list[str],
|
143 |
aggFields: list[str] = [],
|
144 |
rank_feature: dict | None = None
|
145 |
-
)
|
146 |
"""
|
147 |
Refers to https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html
|
148 |
"""
|
@@ -424,7 +423,7 @@ class ESConnection(DocStoreConnection):
|
|
424 |
logger.debug("ESConnection.delete query: " + json.dumps(qry.to_dict()))
|
425 |
for _ in range(ATTEMPT_TIME):
|
426 |
try:
|
427 |
-
print(Search().query(qry).to_dict(), flush=True)
|
428 |
res = self.es.delete_by_query(
|
429 |
index=indexName,
|
430 |
body=Search().query(qry).to_dict(),
|
|
|
28 |
from rag.settings import TAG_FLD, PAGERANK_FLD
|
29 |
from rag.utils import singleton
|
30 |
from api.utils.file_utils import get_project_base_directory
|
|
|
31 |
from rag.utils.doc_store_conn import DocStoreConnection, MatchExpr, OrderByExpr, MatchTextExpr, MatchDenseExpr, \
|
32 |
FusionExpr
|
33 |
from rag.nlp import is_english, rag_tokenizer
|
|
|
141 |
knowledgebaseIds: list[str],
|
142 |
aggFields: list[str] = [],
|
143 |
rank_feature: dict | None = None
|
144 |
+
):
|
145 |
"""
|
146 |
Refers to https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html
|
147 |
"""
|
|
|
423 |
logger.debug("ESConnection.delete query: " + json.dumps(qry.to_dict()))
|
424 |
for _ in range(ATTEMPT_TIME):
|
425 |
try:
|
426 |
+
#print(Search().query(qry).to_dict(), flush=True)
|
427 |
res = self.es.delete_by_query(
|
428 |
index=indexName,
|
429 |
body=Search().query(qry).to_dict(),
|