Hi,
I have multiple search index, and a complex search form. According to the 
user selection in the search form, I apply filters to my search indexes.

At the end, I merge the results with the pipe operator.

I found that I can make a search that results in empty results in each 
individual SearchQuerySet for each individual search index, but when I 
merge them, the result is the complete set of my indexed objects.

Easy to see it in the following pdb session:

> /var/www/astrobin/astrobin/forms.py(567)search()
-> print "len(sqs) = %d" % len(sqs)
(Pdb)
len(sqs) = 0
> /var/www/astrobin/astrobin/forms.py(568)search()
-> print "len(user_sqs) = %d" % len(user_sqs)
(Pdb)
len(user_sqs) = 0
> /var/www/astrobin/astrobin/forms.py(569)search()
-> print "len(image_sqs) = %d" % len(user_sqs)
(Pdb)
len(image_sqs) = 0
> /var/www/astrobin/astrobin/forms.py(570)search()
-> print "len(gear_sqs) = %d" % len(user_sqs)
(Pdb)
len(gear_sqs) = 0
> /var/www/astrobin/astrobin/forms.py(572)search()
-> sqs = sqs | user_sqs | image_sqs | gear_sqs
(Pdb)
> /var/www/astrobin/astrobin/forms.py(573)search()
-> print "len(sqs) = %d" % len(sqs)
(Pdb)
len(sqs) = 1

(where 1 is the total number of objects in my Image search index.

So, why did merging the querysets return an object when all of them had no 
results?

Am I doing something wrong?

I run django-haystack 2.6.1.

Thanks!
Salvatore

-- 
You received this message because you are subscribed to the Google Groups 
"django-haystack" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-haystack+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to