projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2f3697
)
Allow query for '*' that returns all docids.
author
Scott Gasch
<
[email protected]
>
Sun, 17 Apr 2022 18:15:30 +0000
(11:15 -0700)
committer
Scott Gasch
<
[email protected]
>
Sun, 17 Apr 2022 18:15:30 +0000
(11:15 -0700)
logical_search.py
patch
|
blob
|
history
diff --git
a/logical_search.py
b/logical_search.py
index b6d7479879010d6ea40ef813d03e84574ead7e55..2cbe0c781f4ba7889e1b3bcc05373c66a427888e 100644
(file)
--- 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: