Wildcard support in search in haystack with whoosh

288 Views Asked by At

Could anyone help me with implementing the wildcard search in haystack with whoosh. I have tried to search over google but couldn't found any concrete example of it. I want to have following behavior over search for our end user.

When user enters let's 'Crop', the search result should be return all the records where its one of field is containing this word. The result could contains all of the following.

  1. Crop and seeds
  2. Crop Types
  3. Types of crops.

I have tried with _startswith, but its only returning records which are starts with given value. e.g. tag_startswith='xxx'.

Environment Detail:
Django v1.5.3
Haystack v2.1.0
Whoosh v2.5.3

Could someone provide me a concrete example? Any help would be much appreciated.

0

There are 0 best solutions below