Improve search mechanism, allow mistakes in search word #14588
Labels
Feature
Type: New Feature
Must-have
Kanban prioritization: issue must be included in next version
PR available
Solution: issue is being addressed
Search
Label: Which BO under menu is concerned
Projects
Is your feature request related to a problem? Please describe.
This feature request is related to this issue:
#12407
There are two problems with the product search mechanism:
Search words are stored in a table called 'search_word':
1/ Our word length in the search_word table is fixed, so looking for a product whose name is longer than its 'word' column's length won't work if we type the word entirely or even only the end of the word, since the word is truncated in the search_word table.
2/ If we make a mistake in the search term, ex: appre instead of apple, then the search won't work.
Describe the solution you'd like
A solution that could mitigate both those issues would be to implement a Levenshtein distance mechanism.
Basically we could create a Levenhstein search function in mysql, this function would be created during the prestashop install process (after creating the database).
Here is an example of how it is implemented in mysql.
Also checkout this stackoverflow .
The use of this mechanism could be made optional, by making it configurable in the backoffice.
Describe alternatives you've considered
An easier alternative would be to set a much bigger column length to search_word's word column.
The text was updated successfully, but these errors were encountered: