Skip to content

Commit 08745e0

Browse files
committed
update names of doc engine helper functions
1 parent 6e81cf2 commit 08745e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rag/utils/ob_conn.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,13 +1435,13 @@ def _es_row_to_entity(data: dict) -> dict:
14351435
Helper functions for search result
14361436
"""
14371437

1438-
def getTotal(self, res) -> int:
1438+
def get_total(self, res) -> int:
14391439
return res.total
14401440

1441-
def getChunkIds(self, res) -> list[str]:
1441+
def get_chunk_ids(self, res) -> list[str]:
14421442
return [row["id"] for row in res.chunks]
14431443

1444-
def getFields(self, res, fields: list[str]) -> dict[str, dict]:
1444+
def get_fields(self, res, fields: list[str]) -> dict[str, dict]:
14451445
result = {}
14461446
for row in res.chunks:
14471447
data = {}
@@ -1511,7 +1511,7 @@ def highlight(self, txt: str, tks: str, question: str, keywords: list[str]) -> O
15111511
last_pos = token_pos
15121512
return re.sub(r'</em><em>', '', highlighted_txt)
15131513

1514-
def getHighlight(self, res, keywords: list[str], fieldnm: str):
1514+
def get_highlight(self, res, keywords: list[str], fieldnm: str):
15151515
ans = {}
15161516
if len(res.chunks) == 0 or len(keywords) == 0:
15171517
return ans
@@ -1527,7 +1527,7 @@ def getHighlight(self, res, keywords: list[str], fieldnm: str):
15271527
ans[d["id"]] = highlighted_txt
15281528
return ans
15291529

1530-
def getAggregation(self, res, fieldnm: str):
1530+
def get_aggregation(self, res, fieldnm: str):
15311531
if len(res.chunks) == 0:
15321532
return []
15331533

0 commit comments

Comments
 (0)