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

**URL:** https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017
**Category:** Feature
**Tags:** search
**Created:** [September 29, 2017, 10:53am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017 "2017-09-29T10:53:24Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [September 29, 2017, 10:53am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/1 "2017-09-29T10:53:24Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [May 7, 2025, 6:55am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/2 "2025-05-07T06:55:38Z")

</div>

I would like to try to make [Search public topics and PMs simultaneously](https://meta.discourse.org/t/search-public-topics-and-pms-simultaneously/139624) 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.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [May 21, 2025, 11:42pm UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/4 "2025-05-21T23:42:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 18, 2025, 12:22am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/5 "2025-12-18T00:22:03Z")

</div>

Continuing the discussion from [Surface in:all as an option in the Advanced Search UI](https://meta.discourse.org/t/surface-in-all-as-an-option-in-the-advanced-search-ui/391095/5):

> [@nathank](#):
>
> Now I just have to work out how to make it the default search for my site…

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](https://meta.discourse.org/t/surface-in-all-as-an-option-in-the-advanced-search-ui/391095/2), 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!).

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [December 18, 2025, 1:11am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/6 "2025-12-18T01:11:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 18, 2025, 5:47am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/7 "2025-12-18T05:47:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [December 18, 2025, 7:21am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/8 "2025-12-18T07:21:28Z")

</div>

Hmm… what about something like:

```js
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.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [December 18, 2025, 9:03am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/9 "2025-12-18T09:03:17Z")

</div>

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

- [https://meta.discourse.org/t/how-to-search-public-topics-and-pms-simlutaneously-by-default/365093](https://meta.discourse.org/t/how-to-search-public-topics-and-pms-simlutaneously-by-default/365093)
- [Searching public topics and PMs simultaneously and set this option as the default](https://meta.discourse.org/t/search-both-public-topics-and-pms-by-default/71017)

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 20, 2025, 8:19am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/10 "2025-12-20T08:19:10Z")

</div>

> [@NateDhaliwal](#):
>
> Hmm… what about something like:
> 
> ```plaintext
> document.addEventListener("DOMContentLoaded", () => {
> if (window.location == "/search") {
> const searchBar = document.getElementById("someId");
> searchBar.value = "in:all";
> }
> });
> 
> ```

I couldn’t get that to work unfortunately!

> [@Moin](#):
>
> I just wanted to quickly cross-link similar feature requests:
> 
> - [How to “search public topics and PMs simlutaneously” by default?](https://meta.discourse.org/t/how-to-search-public-topics-and-pms-simlutaneously-by-default/365093)
> - [Search both public topics and PMs by default](https://meta.discourse.org/t/search-both-public-topics-and-pms-by-default/71017)

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

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 11, 2025, 9:04pm UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/13 "2025-12-11T21:04:34Z")

</div>

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](https://meta.discourse.org/t/searching-for-content-effectively/273328)), 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

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

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [December 15, 2025, 4:07pm UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/14 "2025-12-15T16:07:53Z")

</div>

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.

[https://github.com/discourse/discourse/pull/36697](https://github.com/discourse/discourse/pull/36697)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [December 15, 2025, 10:03pm UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/15 "2025-12-15T22:03:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 16, 2025, 9:17am UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/16 "2025-12-16T09:17:56Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [December 20, 2025, 2:17pm UTC](https://meta.discourse.org/t/searching-public-topics-and-pms-simultaneously-and-set-this-option-as-the-default/71017/20 "2025-12-20T14:17:50Z")

</div>

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
