mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix: allow search id or _id (#14356)
### What problem does this PR solve? Allow search id or _id when using es as doc_engine. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -170,6 +170,16 @@ class ESConnection(ESConnectionBase):
|
||||
bool_query.filter.append(
|
||||
Q("bool", must_not=Q("range", available_int={"lt": 1})))
|
||||
continue
|
||||
if k == "id":
|
||||
if not v:
|
||||
continue
|
||||
if isinstance(v, list):
|
||||
bool_query.filter.append(
|
||||
Q("bool", should=[Q("terms", id=v), Q("terms", _id=v)], minimum_should_match=1))
|
||||
elif isinstance(v, str) or isinstance(v, int):
|
||||
bool_query.filter.append(
|
||||
Q("bool", should=[Q("term", id=v), Q("term", _id=v)], minimum_should_match=1))
|
||||
continue
|
||||
if not v:
|
||||
continue
|
||||
if isinstance(v, list):
|
||||
|
||||
Reference in New Issue
Block a user