server/search: match only [a-z-]* for named tokens
Adds ability to search for *:* for example. Still not perfect, but it's a start.
This commit is contained in:
parent
0e31e1fd14
commit
1bd8af47b0
1 changed files with 3 additions and 2 deletions
|
@ -92,8 +92,9 @@ class Parser(object):
|
|||
while chunk[0] == '-':
|
||||
chunk = chunk[1:]
|
||||
negated = not negated
|
||||
if ':' in chunk and chunk[0] != ':':
|
||||
key, value = chunk.split(':', 2)
|
||||
match = re.match('([a-z_-]+):(.*)', chunk)
|
||||
if match:
|
||||
key, value = list(match.groups())
|
||||
if key == 'sort':
|
||||
query.sort_tokens.append(
|
||||
_parse_sort(value, negated))
|
||||
|
|
Loading…
Reference in a new issue