WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #21688, comment 12


Ignore:
Timestamp:
08/26/2012 10:33:57 PM (8 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21688, comment 12

    v1 v2  
    33The purpose is to exclude all terms that are one or two characters long. It doesn't make sense to use them, example: `LIKE '%ab%'` would match all posts in many languages. The matches will be irrelevant and the search will be slower.
    44
    5 The above code is the fastest and simplest way to do this. However it's not very precise. It treats "higher" UTF-8 characters like `è, ä` as one letter and misses some like `ọ` (which is 3 bytes). On the other hand that is useful to not remove terms like `東京` (Tokio) which would be removed if we use mb_strlen().
     5The above code is the fastest and simplest way to do this. However it's not very precise. It treats "higher" UTF-8 characters like `è, ä,` etc. as two letters and misses some like `ọ` (which is 3 bytes). On the other hand that is useful to not remove terms like `東京` (Tokio) which would be removed if we use mb_strlen().
    66
    77Thinking this is an acceptable compromise. We may allow some shorter UTF-8 terms that are not essential but won't discard any terms that are needed.