Skip to content

Commit

Permalink
Merge pull request #9 from SnowyCoder/main
Browse files Browse the repository at this point in the history
Fix boost in date/date queries
  • Loading branch information
ZeroCool940711 authored Jan 3, 2024
2 parents 6411df2 + acd0631 commit 9767f58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/whoosh/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ def parse_query(self, fieldname, qstring, boost=1.0):
if is_ambiguous(at):
startnum = datetime_to_long(at.floor())
endnum = datetime_to_long(at.ceil())
return query.NumericRange(fieldname, startnum, endnum)
return query.NumericRange(fieldname, startnum, endnum, boost=boost)
else:
return query.Term(fieldname, at, boost=boost)

Expand Down
1 change: 1 addition & 0 deletions src/whoosh/qparser/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ class RangeNode(SyntaxNode):
"""

has_fieldname = True
has_boost = True

def __init__(self, start, end, startexcl, endexcl):
self.start = start
Expand Down

0 comments on commit 9767f58

Please sign in to comment.