wagtail / guide

A website to teach Wagtail CMS to content editors, moderators and administrators.
https://guide.wagtail.org
BSD 3-Clause "New" or "Revised" License
32 stars 26 forks source link

Partial matches in AJAX search form #371

Closed thibaudcolas closed 1 year ago

thibaudcolas commented 1 year ago

From @laymonage in https://github.com/wagtail/guide/discussions/356#discussioncomment-7423565.

Right now the search logic requires complete words before suggesting results:

Searching for 'snipp' yields 0 results Searching for 'snippet' yields 1 result

It would be nice if the search uses autocomplete or fuzzy matching instead. This might be as simple as changing .search() to .autocomplete() in the views, but I'm not very sure:

https://github.com/wagtail/guide/blob/4fb0682d4af9cf0992ca1ce24baad587764c7796/apps/search/views.py#L18

https://github.com/wagtail/guide/blob/4fb0682d4af9cf0992ca1ce24baad587764c7796/apps/search/views.py#L69