FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Find user with lowercase
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Find user with lowercase [message #17961] Tue, 27 April 2004 19:45 Go to next message
Gribnif is currently offline  Gribnif   United States
Messages: 82
Registered: December 2003
Karma: 0
Member
It seems that the LIKE operator is case-sensitive, so if a user look for "gribnif" they won't find me, since my name is "Gribnif". To avoid this problem, I just made the following change to line 35 of pmuserloc.php.t:

$c = uq("SELECT alias FROM {SQL_TABLE_PREFIX}users WHERE ucase(alias) LIKE '".addslashes(str_replace('\\', '\\\\', strtoupper($usr_login)))."%' AND id>1");

I suggest making this change in the CVS. I think the same change should be made to finduser, as well, at line 47:

$qry = "ucase(alias) LIKE '".addslashes(htmlspecialchars(str_replace('\\', '\\\\', strtoupper($usr_login))))."%' AND";
Re: Find user with lowercase [message #17964 is a reply to message #17961] Tue, 27 April 2004 20:10 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Can't be helped, doing lower() or ucase() on the keyword prevents the SQL engine from using indexes, making the query very slow.

FUDforum Core Developer
Re: Find user with lowercase [message #17965 is a reply to message #17964] Tue, 27 April 2004 20:17 Go to previous messageGo to next message
Gribnif is currently offline  Gribnif   United States
Messages: 82
Registered: December 2003
Karma: 0
Member
Maybe if you have hundreds of users it would, but I have about 50 and there's no noticeable speed decrease. Perhaps you could try it with a few hundred users (like this forum).
Re: Find user with lowercase [message #17966 is a reply to message #17965] Tue, 27 April 2004 20:18 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
For forum with with 50-100 users it may be ok, but most forums have couple of thousand users where this thing becomes unacceptably slow.

FUDforum Core Developer
Re: Find user with lowercase --> full wildcards [message #17975 is a reply to message #17966] Wed, 28 April 2004 06:59 Go to previous messageGo to next message
wfjmueller is currently offline  wfjmueller   Germany
Messages: 95
Registered: December 2003
Location: Darmstadt, Germany
Karma: 0
Member
The more general question is to have full wildcard support in user name searches. I brought this up under "Finding a user by substring match" in this forum.

We run a forum in a research environment. In this case the forum users don't stay anonymous, like in this one, but in contrast should be clearly identifiable. We have enabled 'Alias' in our forum and suggest that users set the alias to the full name. The old user name lookup logic, which matches leading substrings, reduces essentially to a search by first name in this case. If one wants to find by family name, a non-admin is out-of-luck.
Re: Find user with lowercase --> full wildcards [message #17978 is a reply to message #17975] Wed, 28 April 2004 13:29 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The member list search supports forward wild card automatically. So if you don't know the name you can search by the 1st 1-2 letters, perhaps get a longer list matches but find the name non-the less. Most people would only upper case the 1st letter anyway.

Like I said before automatic case-insensitive search would be too slow.


FUDforum Core Developer
Re: Find user with lowercase [message #17983 is a reply to message #17961] Wed, 28 April 2004 13:38 Go to previous messageGo to next message
Gribnif is currently offline  Gribnif   United States
Messages: 82
Registered: December 2003
Karma: 0
Member
Then I think I would suggest that:

1. If the search is case-sensitive, then the user should be TOLD this on the Search page. Otherwise, they wonder why search is "broken".

2. Provide a global option to have slow case-insensitive searching, or fast, case-sensitive searching, with a suitable warning. I don't think many sites have thousands of users, so a lot of people would benefit from this option.
Re: Find user with lowercase [message #17985 is a reply to message #17983] Wed, 28 April 2004 13:44 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
A warning is something I'll consider, somehow in almost 2 years of FUDforum's existence this issue had never come up. So, I can't help but wonder just how common this problem is and whether or not a warning message is really needed.

Even with 400+ users this would be rather slow, since the SQL engine would need to go through every record, lowercase it and perform a case-insensitive comparison. It really does not take many users to cause a slowdown.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Rebuild all themes
Next Topic: Semi-anonymous user
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 09:57:29 GMT 2024

Total time taken to generate the page: 0.02391 seconds