diff options
| author | Scott Gasch <[email protected]> | 2022-04-17 11:15:30 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-04-17 11:15:30 -0700 |
| commit | ade09c17caf24b483525c99e61506bc5cd99a990 (patch) | |
| tree | e2ca96d2bb24df88567ca9e2592794f20b380aba | |
| parent | f2f36979c4a80f70b79b6a38f81f2d8bdcb5170d (diff) | |
Allow query for '*' that returns all docids.
| -rw-r--r-- | logical_search.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/logical_search.py b/logical_search.py index b6d7479..2cbe0c7 100644 --- a/logical_search.py +++ b/logical_search.py @@ -104,6 +104,8 @@ class Corpus(object): ... ) >>> c.query('author:Scott and important') {1} + >>> c.query('*') + {1, 2, 3} """ def __init__(self) -> None: @@ -211,6 +213,8 @@ class Corpus(object): tag1 and key:* """ + if query == '*': + return set(self.documents_by_docid.keys()) try: root = self._parse_query(query) except ParseError as e: |
