Skip to content
This repository was archived by the owner on Dec 30, 2020. It is now read-only.
This repository was archived by the owner on Dec 30, 2020. It is now read-only.

Search issues because of outdated django-haystack&Whoosh and faulty order_by('id_order') #17

@ageron

Description

@ageron

I have had many issues with the searches (the non-configured, out-of-the-box search functionality): sometimes the "total" would be >0, but the "rows" would be empty ([]), even though start=0 and rows=1000. Sometimes the result would be empty even though there should have been a result (I double-triple-quadruple-checked).

I upgraded django-haystack to 1.2.7 and Whoosh to 1.8.4 (I updated requirements.txt accordingly). This fixed most issues, but I still had the first issue (total>0 but rows==[]).

I ended up patching the execute_query function in commis/search/query_transformer.py to remove the order_by('id_order'). This fixes the above issue. I have not looked in details, but I wonder if the id_order field actually exists in all cases: this would explain why count() returns a value >0 (because it probably ignores the order_by clause, but no rows are returned.

Now I still have one remaining issue: searching for "recipes:mongodb::shard" returns an empty result, but searching for "recipes:*shard" works fine. This means that I cannot use many community cookbooks out of the box, including mongodb: I had to patch it to never use searches with : in them.

Hopefully, the above should provide work-arounds for most cases, except the : bug that I have not figured out.. yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions