Skip to content

Commit 8776e97

Browse files
committed
hotfix for author search
1 parent 08f1380 commit 8776e97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

search/services/index/authors.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def author_query(term: str, operator: str = 'and') -> Q:
174174
logger.debug(f"Contains literal: {term}")
175175

176176
# Apply literal parts of the query separately.
177-
return reduce(iand if operator == 'AND' else ior, [
177+
return reduce(iand if operator.upper() == 'AND' else ior, [
178178
(string_query(part, operator=operator)
179179
| string_query(part, path="owners", operator=operator))
180180
for part in re.split(STRING_LITERAL, term) if part.strip()
@@ -184,7 +184,8 @@ def author_query(term: str, operator: str = 'and') -> Q:
184184

185185
if ";" in term: # Authors are individuated.
186186
logger.debug(f"Authors are individuated: {term}")
187-
return reduce(iand if operator == "AND" else ior, [
187+
logger.debug(f"Operator: {operator}")
188+
return reduce(iand if operator.upper() == "AND" else ior, [
188189
(part_query(author_part) | part_query(author_part, "owners"))
189190
for author_part in term.split(";") if author_part
190191
])

0 commit comments

Comments
 (0)