Skip to content

Commit

Permalink
Haystack3/Elasticsearch7 SearchQueryset changes #1
Browse files Browse the repository at this point in the history
"_missing_" on an Event-only index field was too strict a filter, rewrote the query
  • Loading branch information
saschasommer committed Mar 14, 2023
1 parent e59c542 commit 66b6ba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cosinnus/models/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def filter_event_searchqueryset_by_upcoming(sqs):
event_horizon = datetime.datetime(_now.year, _now.month, _now.day)
sqs = sqs.exclude(Q(to_date__lt=event_horizon) | (Q(_missing_='to_date') & Q(from_date__lt=event_horizon)))
# only actual events, no doodles
sqs = sqs.filter_and(Q(_missing_='event_state') | Q(event_state=1))
sqs = sqs.exclude(event_state__lt=1, event_state__gt=1)
return sqs

def build_date_time(date_string, time_string):
Expand Down

0 comments on commit 66b6ba2

Please sign in to comment.