67def search(query, _params) -> EngineResults:
70 if not exact_match_only:
72 res.add(res.types.KeyValue(kvmap=kvmap))
75 kvmap: dict[str, str] = _redis_client.hgetall(query)
77 res.add(res.types.KeyValue(kvmap=kvmap))
79 qset, rest = query.split(
" ", 1)
80 for row
in _redis_client.hscan_iter(qset, match=
'*{}*'.format(rest)):
81 res.add(res.types.KeyValue(kvmap={row[0]: row[1]}))
87 for key
in _redis_client.scan_iter(match=
'*{}*'.format(query)):
88 key_type = _redis_client.type(key)
91 if key_type ==
'hash':
92 res = _redis_client.hgetall(key)
93 elif key_type ==
'list':
94 res = dict(enumerate(_redis_client.lrange(key, 0, -1)))
97 res[
'redis_key'] = key