Search usability and data

Is there a way to get any info on how users are using search? What they are searching for?

We have a lot of categories, so I thought the search would be used almost as a way of global navigation.

I think the ability to search in topic by default should be a community option. Most users may prefer using it as a way to jump around the larger community.

But it’s hard to make the right suggestions without the data.

not quite yet, but I definitely want to add a search log, it later can be used for auto suggest and improving search quality


@sam have you ever considered using Google Analytics events?

I realized I am able to see a number of URLs with query parameter in google analytics. I guess this is triggered either on mobile or when users hit enter. Of the 1000 searches being shown, the large majority seem to be searches for category names. And often when restricted to the topic level (context=topic), the queries are returning 0 results.

If I’m not mistaken, on mobile it is default to search within the topic, but on desktop, the option was default unchecked. Not sure if this inconsistency was intentional.


Got an example of search phrases that would demonstrate this?

Sure. Here were some sample URLs that I can see in Google Analytics.

or searching for a user:

It’s possible that a user will uncheck the checkbox, but just thought it was strange that it was defaulted to search just the topic on mobile.

Pretty sure being defaulted to in topic search on mobile is a bug @sam

1 Like

Yeah will change that, also need to figure out a way to search for users on mobile

And please also consider category names. would be nice if there’s a match on a category title that these could show up at the top of mobile search results. In communities with larger numbers of categories i can see this being very useful.

I really need some UI mockups for this, its tricky to interleave categories and users into the full page UI.

@awesomerobot maybe you have some ideas how Search results for '' - Discourse Meta can handle category and user matches?

In the case of direct, exact character-for-character matches I think it is clear what to do @sam. For example if I search for “tgxworld”… that’s an exact match.

I am more thinking of a general solution here, on desktop we could add a side bar

But still need to think about a UI for mobile. Especially for partial matches.

We could mix the stream up, but it can get a bit confusing, maybe add modes to search or something


I like GitHub’s solution here. Simple sidebar that easily downgrades to a drop-down or tabs in mobile view:

I find it odd that they didn’t include the match count - “7 repositories”, “164 issues” etc - in the mobile interface, since that’s a very important clue.


@erlend_sh I think GitHub is showing more a drilldown, as opposed to direct access to a category.

I was thinking more the way that Twitter will show an account. Whether it’s at the top or in a column. I think categories and posts can be on the same list, as long as we had a slight different way of labeling / displaying the category. Will try to give it more thought on my end.

Yeah I think that this is probably the way to go on mobile — we don’t want to make assumptions of what the priority in the search is… and stacking any sort of results would imply priority by pushing down other groups of results… while tabs are typically seen as on the same level.


Are there any plans to add analytics for search? We have an internal training department, and they’re curious to see what users are searching on in order to help develop curriculum.

1 Like

@Jenn_Briden Have you tried looking to see the data in Google Analytics?

I don’t see any other threads on this, but it’s also pretty old. Are there any solutions built-in to discourse to review search behaviors?

@sam , just curious if you ever added a log for searches…if so, maybe I can get something from Data Explorer. Also, is there an update on if search analytics is on a roadmap? Right now, I don’t know if anyone uses the search feature and deflection is a big part of how I like to measure ROI with self-service platforms. Things like:

  • What % of users/visitors use search
  • What % clicked on a suggested result
  • Top 20 queries
  • What % of searches were refined
  • Top 20 refined search terms
  • What % used Advanced Search
  • Etc…


1 Like

We actually did complete the work of logging the information. You can try out:

SELECT term, count(*) searches, 
 sum(case when clicked_topic_id is not null then 1 else 0 end) 
 "continued from search"
from search_logs
where created_at > current_timestamp - interval '30' day
group by term
order by count(*) desc
limit 100

It Data Explorer, it will show you top 100 searches and even counts of who actually clicked through from search. I find the results super interesting.

We will work on exposing some more of this via the dashboard direct.


Thanks to @techAPJ we now have a UI for this:

Head to Logs => Search Logs in the admin UI.

(in other news our click through on theme is way up due to recent search tweaks … we were sitting at 1/6 click throughs and now are more around 1/3, so yay :1st_place_medal:)