My question may be a bit strange, but it's been bothering me since the behavior is not what I expected. Here is my query:
query = request.GET.get('q','')
#in search_indexes:
#start_datetime = indexes.DateTimeField(model_attr='start_datetime',null=True)
#end_datetime = indexes.DateTimeField(model_attr='end_datetime')
search_events = SearchQuerySet().models(Event).filter(content=query).
filter(end_datetime__gte=datetime.now()).
order_by("start_datetime")
Now I type in a query like "asdfasdfjasldf lolol hwtf asdlfka"
and I still get 3 results. (Note, I only have 5 events to start with. Not sure if that could affect anything.) I print out the scores, and they are [42,42,42]
. Doesn't filter()
match on exact phrases? Especially if I use quotes?
//edit
I also tried using auto_query
, and the results are the same.
I'm really confused about what's happening, so hopefully somebody can help clear this up. Thanks in advance!