-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
searchqueryset.all() return empty list when no input. #1021
searchqueryset.all() return empty list when no input. #1021
Comments
+1. With:
haystack/forms.py: SearchForm.no_query_found() docstring suggests: "Should you want to show all results, override this method in your But this doesn't work - self.searchqueryset.all() returns an empty SearchQuerySet. QuerySet.all() returns all objects, so it's confusing to me that SearchQuerySet.all() returns the empty set. Is there a 'proper' way of fetching all objects via the SearchQuerySet? If not, I'll try and find a filter()/exclude() that will trigger the effect I'm after without excluding any objects, but I think the SearchForm.no_query_found() docstring should be corrected because it's just wrong at the moment. |
+2 With:
SearchQuerySet().all() returns an empty list. I know the index is created properly because when I use the basic_search() view, I get results just fine. |
Hi guys, I think this might be by design. when using .filter(), my results are coming back fine. still, I'd like to see .all() return all results! I guess I'm not clear on the purpose of the function. see the comments in the response to my stack overflow question: http://stackoverflow.com/questions/25695904/django-search-setting-haystack-default-operator-or-has-no-effect |
I found myself with the same problem: self.searchqueryset.all() returns an empty list. In my case, this behaviour is related with the field type of text in the SearchIndex: |
With indexes.EdgeNgramField field type, self.searchqueryset.exclude(content='foo'), as proposed, returns the objects from the index. Thanks for commenting. |
Same here. If the field holding the Whoosh 2.7.3 |
+5 With: Thanks all for this thread, and @kinuax for the 'excludes' hackaround which works for now. |
Hi guys, this is still an undocumented, apparent bug.
|
I am using |
Hi Everyone, I've looked into this issue and it seems that there is a tokenization problem for N-gram fields as they are I've created a pull request(s?) for this issue, which you can browse below if you are interested in seeing the fix:
In the meantime, the simplest solution I've used is |
I want to get all results when there is no input.
So I add below code to my search form.It returns a empty list.
It returns all when I exclude a special char.
env: win 7, django 1.4 , haystack 2.1.0, whoosh 2.5.7
The text was updated successfully, but these errors were encountered: