-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diacritics on search:
parameter
#1665
Comments
On the Channel Model, there's a conditional to use foreach ($terms as $term) {
if ($search_sql !== '') {
$search_sql .= $andor;
}
if ($term == 'IS_EMPTY') {
$empty = true;
// Empty string
$search_sql .= ' (' . $col_name . ($not ? '!' : '') . '=""';
// IS (NOT) NULL
$search_sql .= $not ? ' AND ' : ' OR ';
$search_sql .= $col_name . ' IS ' . ($not ?: '') . ' NULL) ';
} elseif (strpos($term, '\W') !== false) { // full word only, no partial matches
// Note: MySQL's nutty POSIX regex word boundary is [[:>:]]
$term = '([[:<:]]|^)' . preg_quote(str_replace('\W', '', $term)) . '([[:>:]]|$)';
$search_sql .= ' (' . $col_name . ' ' . $not . ' REGEXP "' . ee()->db->escape_str($term) . '") ';
} else {
$search_sql .= ' (' . $col_name . ' ' . $not . ' LIKE "%' . ee()->db->escape_like_str($term) . '%") ';
}
} The Search Module doesn't use
|
@robsonsobral I think there could be different expectation here. It would probably best if the both would use same code, to keep the things DRY, and make the behaviour configurable with a parameter or flag. |
Really? I don't know. I would expect both work the same way. Today, we can't make them gave the same results. I guess, the better way I can see this issue is that An example!
And now without diacritics:
The same problem doesn't happen with Search Module. Does it make sense? |
So the problem is not with search on |
I'm sorry, @intoeetive . Yeah, you're right. My intention was to show that Search Module has a different approach to the same issue. |
I'm not a database guy, so it took me some time to get my mind around this. What I have found isn't cool. The current search for full words simply doesn't work properly on Search form. So the solution used there isn't a solution for the There are two ways to make full words search to work both on search module as
The way things are isn't good. |
When submitting "dívida", the search module uses "divida", but the
search:
parameter doesn't!Shouldn't the
search:
parameter behave just like the Search Module?The text was updated successfully, but these errors were encountered: