DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Searching for users

 5 Replies
 3 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 54
Growing Member

In previous DNN versions (pre DNN9) we had a filter that allowed us to filter users based on different options (name, email, profile property, ...). On DNN 9 this is all gone and I can't seem to find a way to find users based on any profile property.

Questions:

- is there a way to specify which fields will DNN use for the search filter?

- if not, what is it currently using for filtering?

Vicenç Masanas
Disgrafic ITec SL Banyoles - Spain
Growing Member
Posts: 54
Growing Member
I think I found the answer myself.
1. No, the list of searched fields is fixed on stored proc Personabar_GetUsersBySearchTerm

2. The current filter search includes fields:
UserName, DisplayName, Email, FirstName, LastName

So if you need to add more options to the search you'll need to hack this stored proc.
Vicenç Masanas
Disgrafic ITec SL Banyoles - Spain
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
Posted By Vicenç Masanas on 16 Jul 2019 03:06 AM
I think I found the answer myself.
1. No, the list of searched fields is fixed on stored proc Personabar_GetUsersBySearchTerm

2. The current filter search includes fields:
UserName, DisplayName, Email, FirstName, LastName

So if you need to add more options to the search you'll need to hack this stored proc.

Or, "fix" it with a pull request? :) 

Growing Member
Posts: 54
Growing Member
Will, not sure myself how to "fix" this.

Do you think this should be an option somewhere? or we just can make the system search for every profile property?
Vicenç Masanas
Disgrafic ITec SL Banyoles - Spain
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

I think long-term, this use case could be much more common. Adding an advanced search option to the core seems to be a good idea.  :)

Veteran Member
Posts: 546
Veteran Member
MVP
MVP
You're an MVP!
Vicenç,
please be aware that there are different requirements per use case. I optimized the current stored procedure for speed, in order to support type suggest - even on sites with millions of registered users. Extending this to search user profile as well would slow down results and i.e. affect the current search.
Of course, the sproc could be enhanced with an additional param "searchColumns", but IMO this shouldn't be used for type suggest.
I would need a proper use case description to extend the sproc and maybe you can enhance the users PB extension to support it appropriately :)

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved