From ade09c17caf24b483525c99e61506bc5cd99a990 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sun, 17 Apr 2022 11:15:30 -0700 Subject: [PATCH] Allow query for '*' that returns all docids. --- logical_search.py | 4 ++++ 1 file changed, 4 insertions(+) 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: -- 2.47.1