• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Show exact match first when searching for user by username in AdminCP

The Sandman

Well-known member
#1
Most often when "searching" for a user in the AdminCP (Home, Users, and Search for Users pages) I already know which user I want - I just want to get to their Edit page. However, even when inputting an exact match for the username the results are shown as an alphabetical list (often multi-page) of usernames which contain the searched "name" anywhere within.

I'd prefer the results to show the exact match first, then any close matches that contain the searched username letters at the start, then any remaining results that contain the matched username letters within.

As an example, say I have a user named "Ohn". If I want to navigate to his Edit page in the AdminCP, I type in Ohn. This currently brings up as slew of Johns and Johnnys with a variety of additional names, numbers, and characters appended. You might have to go through several pages of Johns before you get to Ohn.

So in the example, if I type in Ohn, I'd like to see Ohn shown first in the results, followed by Ohn2 and Ohnny, then the multitudes of Johns and Johnnys.
 

Chris D

XenForo developer
Staff member
#2
I think this is a valid suggestion, but an alternative way to do what you want is to go to List Users and type the user's name into the filter with the prefix match checkbox checked. That should have the same effect.
 

The Sandman

Well-known member
#3
I think this is a valid suggestion, but an alternative way to do what you want is to go to List Users and type the user's name into the filter with the prefix match checkbox checked. That should have the same effect.
I was going to say sure, but that's two extra clicks away from where I am at the moment - but I just tried it and it actually works the same way as the searches - type in Ohn and you'll get pages of alphabetical results with the Johns and Johnnys first. Only difference is that there is only one page or results with the following noted at the bottom: There are more records matching your filter. Please be more specific. So by putting the exact username in the filter I can never get to the correct user?
 
Last edited:

Chris D

XenForo developer
Staff member
#4
Well, it's roughly the same number of clicks...

As I say, you have to click the "Prefix match" checkbox next to the filter.

The way in your first post produces:

upload_2015-9-24_22-16-42.png

I think you're now doing this, with the filter:

upload_2015-9-24_22-17-22.png

But if you just click "Prefix match" you get:

upload_2015-9-24_22-17-47.png
 

Chris D

XenForo developer
Staff member
#6
It simply means that what you're searching for must be prefixed with exactly what you have typed.

So if you had users John, Ohn, Ohn2, Ohn3 then all but John would be shown because all of the others are prefixed with "Ohn".

And how about adding a "prefix match" check box to the rest of the AdminCP User Search facilities?
That would be one solution, yes. But for now, there is a solution with the same effect, at least :)
 

Martok

Well-known member
#8
Um, yes.

You are referencing the second definition of prefix that I linked to. The first that I quoted is a complete definition.

Do feel free to contact the Oxford English Dictionary if you think they are wrong. ;)
 

Jeremy P

Well-known member
#10
Well, the linguistic definition is not "wide" enough in scope to account for the other definitions, as this misunderstanding spells out. In that sense, it is relatively "narrow." Perhaps that is too strong a word, and maybe I should have used a word like "limited" instead... but then we're back at the issue of scrutinizing the use of words whose exact meaning and scope can be slightly ambiguous (which comes across as a bit condescending, by the way).

Nevertheless, for what it's worth, I agree with your suggestion that the ACP Search should have such functionality.
 

The Sandman

Well-known member
#11
And how about adding a "prefix match" check box to the rest of the AdminCP User Search facilities?
If you do implement this at some point, I'd also suggest having the check box checked as the default setting (or have an option switch so that each admin can set their own default).
 

Alfa1

Well-known member
#12
What I find weird about it is that if you search for a user in admincp then this will show you matching membernames. When you click on the use you want, you are not taken to the accounr but rather a search results page for the string you entered. This is counterintuitive and almost seems to be a bug.
 

Biker

Well-known member
#13
What I find weird about it is that if you search for a user in admincp then this will show you matching membernames. When you click on the use you want, you are not taken to the accounr but rather a search results page for the string you entered. This is counterintuitive and almost seems to be a bug.
Big time. Especially if the string is common and the name you want ends up being on page 5 out of a 10 page result. Aggravating, to say the least.
 

AndyB

Well-known member
#14
Most often when "searching" for a user in the AdminCP (Home, Users, and Search for Users pages) I already know which user I want - I just want to get to their Edit page.
I suggest not using the "Search for Users" link, instead use the search box to the right as seen here:

pic001.jpg

The dropdown will work as you want with prefix priority and you can quickly find the exact member.
 

Mike

XenForo developer
Staff member
#17
Not really, that is just a general search -- it's the same as searching by username which doesn't have exact match support. The click just fills the text box. Given that we have no concept of exact username search in these cases, the main "fix" would be to remove the autocomplete stuff entirely from that section and I don't think that's necessarily helpful.
 

Chris D

XenForo developer
Staff member
#18
Indeed.

I would suggest that for most username searches, the general search then filtering that down using the filter and prefix match should be sufficient.
 

Digital Doctor

Well-known member
#19
I'd prefer the results to show the exact match first, then any close matches that contain the searched username letters at the start, then any remaining results that contain the matched username letters within.
That is exactly what should happen.

When admins are using this "search" .... it isn't true searching - it is retrieving - as the admin knows exactly what they are looking for.
 
#20
Old thread, but new Xenforno user having just converted two sites and found this to me a thing like "What the Heck?" I was doing what I thought was right...I go to users, I use the search box, I type in the user name, in this case Rick, and I SEE HIS AVATAR as the first person in the drop down. I think "This is great!" only then to click on his and then get many pages of search results that I then need to look through.

IMHO, really poor use of a search box. Finding this old thread I am shocked it has not been updated/fixed/corrected already.

(Coming from using Sphinx, Xenfono site search etc is very poor and our users are not happy with the results. The biggest issue with this is that it look at THREAD START date and not last post date in a thread. As such, you have have a very old thread, with LOTS of info that is still active and yet it will pull up a new thread with two posts before it with the better thread way down in the list. I degrees, this is for another topic. However the above user search is still not right IMHO. :))