Are the custom fields searchable in the user directory?

This piece of knowledge was a huge missing piece for me! Previously, I just made certain custom fields searchable, added a column for their display at /u, and then searched right away. I didn’t get any results returned because the Jobs::ReindexSearch background job hadn’t run yet.

Now that I know this key piece of info, I was able to experiment with how I would use the custom fields search. Unfortunately, there are too many UX issues with the current functionality that would prevent me from allowing my forum members to use the custom field search.

I recorded this video to show Discourse devs, plugin developers, or anyone else who’s curious what I mean.

If you can’t or don’t watch the video, here are my written highlights of the UX issues.

  • The default option for the display is probably something other than All Time (e.g., Week or Month). So searchers might think that the search results they get are limited to people who have been active in the past X week / month / quarter / year.
  • The search box has text that says “filter by username.” Nothing about that says “Use me for a keyword search.”
  • The drop-down says “all groups” and people could be forgiven for thinking that the primary use of the search is group related and not forum-wide.
  • You can’t search by individual custom field. You’re searching all the fields at once and that might return too many results depending on your number of users and/or the keyword(s).
  • Typing in the search box returns real-time results as you continue to type. But the cursor has such a short stay time before new results are loaded and the cursor moves off the input field. Some people type slow or pause, so this isn’t great.
  • You have to scroll to the right for custom fields. And that’s not realistic on mobile view where most people are accessing the forum.