Search public topics and PMs simultaneously

Continuing the discussion from Create/See and Create Permissions (again):

I think this is a great idea. At the moment we have the in:private modifier to search PMs, so maybe something similar like in:all or in:everywhere?

7 Likes

@david: Thanks for making this thread (I was going to wait until I had some code :slight_smile: ). I hacked on this a little bit between meetings yesterday and this morning, and I have a proof of concept that adds an in:all search tag: GitHub - adqm/discourse at search_all

A few things worth thinking about:

  • This is just a quick hack, and I’ve not really tested except with a small little test instance with a couple of posts.
  • Is in:all the right name?
  • It might be nice to be able to see in the lst which of the results are PMs and which are topics
  • It needs a checkbox in the “advanced search” window

I’m happy to keep hacking at it when I have time. And I don’t really know Ruby, Rails, or the Discourse codebase at all yet, so any feedback and constructive criticism is definitely welcome!

5 Likes

Awesome! Please do open a PR once you’re ready, and then people can comment more easily.

I think it’s ok, unless anyone has any better ideas? cc @codinghorror?

It would, but I wouldn’t worry about that to start with. That can be a later PR.

Again, this would be nice, but it doesn’t necessarily have to be done at the same time. This is a pretty power-user-targeted feature anyway.

6 Likes

After poking it a bit more, turns out it’s not quite ready yet…but I’ll keep messing with it, and I’ll submit a PR when I squash the bugs I know about.

7 Likes

Just opened a PR. Happy for thoughts, feedback, and criticism!

7 Likes

in:all is fine in:everything is too much to type imo.

8 Likes

Thanks to @hartz, this is now implemented :confetti_ball:

You can use in:all to search your PMs and public topics in one place. For example:

10 Likes

Hmm. Shouldn’t PM results have the PM envelope next to the result? Otherwise how do you know which is which?

11 Likes

Yeah that would be good. @hartz actually already suggested that but I pushed for getting the basic feature in first.

@hartz would you like to try and get this working in a second PR? If not I can take a look at it.

8 Likes

Sure, I’m happy to give it a shot. I’m interested to poke around a bit more in the codebase (since I’m not sure I quite have the lay of the land yet), and this would be a good way to do it.

But it will be several days, probably, before I’m able to take a real look, so if you wanted to jump in and take care of it, that’s cool, too.

6 Likes

@david: I finally had a chance to take a look at this (differentiating the display of PMs and topics in search results), and I have an inelegant hack in place locally that seems to work, but that probably needs quite a bit of refinement. Should I open a separate topic in the dev category or something like that if I think it’s not quite ready for prime-time, or should I just open a PR and use that as the place for discussion?

4 Likes

If you have something working, a PR would be great - makes it easier to comment on specific parts of the code. If you like, github has a new “Draft PR” feature (hit the arrow next to “create pull request” before you submit it).

6 Likes

OK, sounds good, thanks! I just put in a PR.

4 Likes