Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the method of boolean query #243

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

alex-au-922
Copy link
Contributor

Added the Occur enum, Query.boolean_query method and corresponding tests.

Expected usage:

@staticmethod
def boolean_query(subqueries: Sequence[tuple[Occur, Query]]) -> Query:
    ...

Query.boolean_query([(Occur.Must, query1), (Occur.MustNot, query2), (Occur.Should, query3)])

Important Changes

  • Added a wrapper struct struct OccurQueryPair(Occur, Query) which lives in the lifetime of the python object subqueries for parsing list of tuple of Occur and Query
  • Added the Clone implementation of Query class for the extract() method to extract Query class from the PyTuple

@cjrh
Copy link
Collaborator

cjrh commented Apr 22, 2024

Thanks!

@cjrh cjrh merged commit 1d61b96 into quickwit-oss:master Apr 22, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants