Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Searching User Custom Fields View modes: 
User avatar
Member
Member
Ian Muir - 12/12/2011 2:36:07 PM
   
Searching User Custom Fields
We've added a custom field for users called Company, is it possible to search users by this field?

User avatar
Member
Member
Ian Muir - 12/12/2011 2:58:47 PM
   
RE:Searching User Custom Fields
Just a note, I already verified that the field is checked off as searchable under Development > System Tables > User > Search Fields

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/14/2011 4:40:48 AM
   
RE:Searching User Custom Fields
Hello,

Yes, this should be possible. Please make sure a culture is assigned to the search index.
Check if smart search is searching default content correctly and rebuild the smart search index.

Best regards,
Boris Pocatko

User avatar
Member
Member
Ian Muir - 12/14/2011 7:44:51 AM
   
RE:Searching User Custom Fields
I've got the smart search created and it still doesn't appear to be searching the field in the user search.

Just to be clear, this is in the Adminstration area not on the front end of the site. The client needs a way to search users by custom fields and we're hoping that we don't need to build and entire custom module just to search by a custom field.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/15/2011 7:12:01 AM
   
RE:Searching User Custom Fields
Hello,

Are you defining a custom web part within the interface or using the standard search field available there? Could you please post a screenshot of the search field, so I am sure, which you are using?
Additionally, is the search searching the users correctly if you for example use their name?

Best regards,
Boris Pocatko

User avatar
Member
Member
Ian Muir - 12/15/2011 8:40:54 AM
   
RE:Searching User Custom Fields
I'm reluctant to post images of their user administration pages in a public forum; I don't want to post their users' data.

I'm not creating any custom web parts.

I'm using the built-in user administration in the cms desk. They just need a way to search users via a custom field in the cms desk > administration > users section. I'm guessing that due to the confusion here, it's not possible to search users via a custom field.


User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/16/2011 5:24:29 AM
   
RE:Searching User Custom Fields
Hello,

You can of course alter the image to hide user specific information. Anyway, this isn't a standard smart search dialog. The SQL query is constructed on the fly in the file around line 533:

\CMSModules\Membership\Controls\Users\UserFilter.ascx.cs

You need to change this line:

where = "((UserName {0} N'{1}') OR (Email {0} N'{1}') OR (FullName {0} N'{1}') OR (UserNickName {0} N'{1}'))";

To this one:

where = "((UserName {0} N'{1}') OR (Email {0} N'{1}') OR (FullName {0} N'{1}') OR (UserNickName {0} N'{1}') OR (CustomFieldUser {0} N'{1}') OR (CustomFieldUserSettings {0} N'{1}'))";

Please note, that the bold strings are the code names of your custom fields defined in the User table or User - Settings system table.

Best regards,
Boris Pocatko

User avatar
Member
Member
Ian Muir - 1/26/2012 1:48:30 PM
   
RE:Searching User Custom Fields
Sorry about the delayed response here.

I think there is some confusion.

In the context help, on Development>System Tables>Users>Search Fields it states:

Searchable - if checked, content of the field will be searchable in the <field code name>:<searched phrase> format, which searches only through the fields and not through the other fields

Which is what we're trying to do, but it's not working. I'm not trying to build anything new, I'm just trying to see if we missed a setting someplace. Do we need to updated system files to accomplish this? If so, you should probably pull it out of the documentation.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/31/2012 6:03:29 AM
   
RE:Searching User Custom Fields
Hello,

Those are different features. In your case you are modifying an internal user control which uses an internal filter. This functionality isn't the smart search functionality described in the documentation. The smart search functionality is coupled with the smart search web parts available in the system. The internal filters which you are trying to change don't use this functionality.

Best regards,
Boris Pocatko