Project60 / org.project60.banking

CiviCRM banking extension
18 stars 39 forks source link

Improve name-based search handling no-ascii characters #121

Open bjendres opened 9 years ago

bjendres commented 9 years ago

The getquick-lookup we use handles it perfectly, but the suspicion is that the later similar_text function doesn't.

bjendres commented 9 years ago

@vangelisp will take a look

bjendres commented 9 years ago

As an alternative, we should also look at http://www.artfulsoftware.com/infotree/qrytip.php?id=552

VangelisP commented 9 years ago

Since most (if not all) the techniques used (similar_text/levenshtein/soundex/metaphone) are used with English text, one acceptable solution would be to convert all strings for comparison to English (normalize), by using the Transliterator class, as seen here:

Then after normalizing, use either the Levenshtein function through PHP (as described on my above link's top part) OR through a custom function in MySQL that can do that (as the link you've posted in your comment). Using the MySQL method for string comparison would decrease the load of PHP.

PS1. Levenshtein method needs some tweaking to get the results adapted to CiviBanking's needs PS2. This php class is only available with PHP 5.4 and afterwards

Let me know @systopia what you think on this approach.

bjendres commented 6 years ago

I think we should tackle this in 0.8 along with #140