"Advanced Search" for private messages not triggering properly

AI-generated summary

In the discussion titled “Advanced Search” for private messages not triggering properly, jerry0 reports that while searching within private messages, the Advanced Search feature opens but fails to apply the correct filters — specifically, it shows “private_messages:{username}” instead of the expected “in:private” filter used when selecting “Only return topics/posts… In my messages” via Advanced Search. This inconsistency causes confusion for users. techAPJ acknowledges that while the current behavior still filters private messages (via “private_messages:{username}”), it doesn’t align with user expectations. They agree the interface should reflect the correct filter (“in:private”) when triggered from the Messages page and confirm the fix has been implemented in commit 704cca3. The update ensures Advanced Search opens with the appropriate filter applied, improving usability for users relying on private messaging.

As per the discussion from How do you search Your Private Messages?:

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

However, Advanced Search is not being triggered properly.

When you search in a category, you see this:

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

Same with search in a user page:

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 :persevere:

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:

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

Thanks!

4 Likes

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

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

https://github.com/discourse/discourse/commit/704cca3de25f1e58f9561100aeebf9cc6989301a

Thanks for bringing this in our notice. :+1:

6 Likes