Skip to content

Commit

Permalink
Fix invalid exact match edtf query, re archesproject#10250
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt authored and aj-he committed Jan 11, 2024
1 parent 7c299e1 commit e2e3b49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arches/app/datatypes/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ def add_date_to_doc(query, edtf):
if value["op"] == "eq":
if edtf.lower != edtf.upper:
raise Exception(_('Only dates that specify an exact year, month, and day can be used with the "=" operator'))
query.should(Match(field="tiles.data.%s.dates.date" % (str(node.pk)), query=edtf.lower, type="phrase_prefix"))
else:
operators = {"gte": edtf.lower, "lte": edtf.lower}
query.must(Range(field="tiles.data.%s.dates.date" % (str(node.pk)), **operators))
else:
if value["op"] == "overlaps":
operators = {"gte": edtf.lower, "lte": edtf.upper}
Expand Down

0 comments on commit e2e3b49

Please sign in to comment.