# "Advanced Search" for private messages not triggering properly

**URL:** https://meta.discourse.org/t/advanced-search-for-private-messages-not-triggering-properly/87374
**Category:** Bug
**Created:** [May 13, 2018, 4:38pm UTC](https://meta.discourse.org/t/advanced-search-for-private-messages-not-triggering-properly/87374 "2018-05-13T16:38:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jerry0](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerry0/32/94523_2.png) [@jerry0](https://meta.discourse.org/u/jerry0)
#### Post date: [May 13, 2018, 4:38pm UTC](https://meta.discourse.org/t/advanced-search-for-private-messages-not-triggering-properly/87374/1 "2018-05-13T16:38:15Z")

</div>

As per the discussion from [How do you search Your Private Messages?](https://meta.discourse.org/t/how-do-you-search-your-private-messages/22111/5):

I’m referring to this function is working (when you search in your messages page):

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/0/10992bb560b9b4a3e8258d3c4bef8c0f00c5bffe.png)

> [@codinghorror](#):
>
> Well, it would be the check box underneath, the same way it happens on the user page or the category page

However, Advanced Search is not being triggered properly.

When you search in a category, you see this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/9/d9924871ae607f1d4a7c8a15a3ad96ab26632fda.png)

Which results in Advanced Search being triggered and opening up against the results list with the appropriate search selection (category filters) applied:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/5/55e75de1ea079b7cf5822f6200843e864ad9536e.png)

Same with search in a user page:

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/5/457f74d7d148f4088bd30f316e24a78a7845c38d.png)

However when you search in private messages Advanced Search is not triggered properly, is when it opens nothing gets applied in Adanced Search … so it’s not at all clear why it’s being triggered in the first place, which is really confusing 😣

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/9/0973193f5a9d4bba894aec52b25d509c6444c5dc.png)

In fact the search term being applied in the search box is “private\_messages:{username}” whereas the search term applied when you tick the corresponding advanced search option (“Only return topics/posts… In my messages”) is “in:private”

So, in summary a fix to this would be, when you search from Messages page and click “Search messages” tickbox, Advanced Search opens up with the correct search selection applied, like this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/e/be68ab78cb3db1c916977a3066f7fc495b3ddf1b.png)

i hope that’s all clear… it would certainly help our users (and other users relying on private messaging) at lot.

Thanks!

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 30, 2018, 9:45am UTC](https://meta.discourse.org/t/advanced-search-for-private-messages-not-triggering-properly/87374/2 "2018-05-30T09:45:37Z")

</div>

> [@jerry0](#):
>
> the search term being applied in the search box is “private\_messages:{username}”

That search term/filter works too, it filters to personal messages so the functionality is not broken.

> [@jerry0](#):
>
> whereas the search term applied when you tick the corresponding advanced search option (“Only return topics/posts… In my messages”) is “in:private”

> [@jerry0](#):
>
> when you search from Messages page and click “Search messages” tickbox, Advanced Search opens up with the correct search selection applied

I agree that this is more accurate and what the end user expects. Done in:

[https://github.com/discourse/discourse/commit/704cca3de25f1e58f9561100aeebf9cc6989301a](https://github.com/discourse/discourse/commit/704cca3de25f1e58f9561100aeebf9cc6989301a)

Thanks for bringing this in our notice. 👍

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 31, 2018, 5:19am UTC](https://meta.discourse.org/t/advanced-search-for-private-messages-not-triggering-properly/87374/3 "2018-05-31T05:19:54Z")

</div>


