Skip to content

Commit

Permalink
Force dataset argument to filter_query
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Jan 13, 2025
1 parent 6b28ba4 commit 06fae56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yente/search/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class Operator(str, enum.Enum):


def filter_query(
scope_dataset: Dataset,
shoulds: List[Clause],
scope_dataset: Optional[Dataset] = None,
schema: Optional[Schema] = None,
filters: FilterDict = {},
include_dataset: List[str] = [],
Expand Down Expand Up @@ -132,9 +132,9 @@ def entity_query(
shoulds.append({"match": {"text": value}})

return filter_query(
dataset,
shoulds,
filters=filters,
scope_dataset=dataset,
schema=entity.schema,
include_dataset=include_dataset,
exclude_schema=exclude_schema,
Expand Down Expand Up @@ -181,8 +181,8 @@ def text_query(
}
# log.info("Query", should=should)
return filter_query(
dataset,
[should],
scope_dataset=dataset,
schema=schema,
filters=filters,
include_dataset=include_dataset,
Expand All @@ -201,7 +201,7 @@ def prefix_query(
should: Clause = {"match_none": {}}
else:
should = {"match_phrase_prefix": {"names": {"query": prefix, "slop": 2}}}
return filter_query([should], scope_dataset=dataset)
return filter_query(dataset, [should])


def facet_aggregations(fields: List[str] = []) -> Clause:
Expand Down

0 comments on commit 06fae56

Please sign in to comment.