Searching public topics and PMs simultaneously and set this option as the default

Is there a way to search for both public topics and PMs at once – and make that the default behavior for my site?

User case: I often know I’ve talked with someone about something but I can’t recall whether it was a message or a topic. To find it, I sometimes have to do two searches. And that’s charitably assuming that I use the correct keywords, which isn’t always the case :slight_smile:

3 Likes

I would like to try to make Search public topics and PMs simultaneously the default behavior in our forum.

Has anyone tried this before?

Context:
We use discourse as communication platform for a school. Most categories are restricted to groups.
Communication via PMs is the normal way to address people across groups.
When searching for a conversation, users do not remember, if to search for a PM or a topic.

4 Likes

I have not heard of this before - it feels like a feature request so moving it to Feature.

1 Like

Continuing the discussion from Surface in:all as an option in the Advanced Search UI:

It turns out that this is not easily done! Hence a new feature request.

In our instance, which utilises group inboxes quite a bit, it is quite common to want to include messages in search. Prepending in:all to a search achieves this, but isn’t something that can be easily taught to users.

Thanks to the wonderful recent work by @zogstrip, this is now possible via the UI. While this is brilliant for our power users, our noob users will take a while to find it, forget to use it, etc etc.

I’d love to have a way to make it the default search for my users (and me!).

3 Likes

Hmm… perhaps you could use JavaScript to add in:all to the search box?

I’ve had a go with some JavaScript, but that is quite beyond me and my dumb AI support it seems. Any suggestions?

Hmm… what about something like:

document.addEventListener("DOMContentLoaded", () => {
  if (window.location == "/search") {
    const searchBar = document.getElementById("someId");
    searchBar.value = "in:all";
  }
});

This is from the top of my head; I don’t have my laptop as I’m on vacation.

The better solution is to use api.onPageChange of the plugin API, but this may still work.

I just wanted to quickly cross-link similar feature requests:

1 Like

I couldn’t get that to work unfortunately!

Good point! I missed the existing topics. I’ve flagged them to all be merged.

1 Like

I’ve got a couple of sites which make extensive use of Group Messages, which is a great way to have ‘off Forum’ topics clearly delineated from the open Categories.

However, this gives a bit of a functional search silo. While it is possible to search across Messages and the wider forum using in-all (see Searching for content effectively), it isn’t actually possible to access this from the search UI.

For our use case, it would be very helpful to have in the Advance Search UI:

  1. An easy-to-use option to control if Messages (and/or Chat) are included in search

    • this could work as an additional drop-down option nicely here:

    • or maybe easier as one of the checkboxes here (as these simply instert the prefex into the search bar):

  2. The ability to set a site-wide default for this

2 Likes

Having a mix of checkboxes and a dropdown always felt odd to me. So I “merged” them all in one “multi-select” dropdown and made sure the “in:all” filter is also in the list.

4 Likes

@nathank the above PR is live on meta, what do you think?

1 Like

That is a pretty sweet (and sensible) improvement!!!

Now I just have to work out how to make it the default search for my site…

1 Like

To recap, the search by topic and PMs is complete and in:all is now in the filter.

The remaining part to complete the feature request is the ability to make it the default search

2 Likes