Pesquise tópicos públicos e MP simultaneamente

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?

9 curtidas

@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 curtidas

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 curtidas

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 curtidas

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

7 curtidas

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

8 curtidas

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:

11 curtidas

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

12 curtidas

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 curtidas

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 curtidas

@david: Finalmente pude dar uma olhada nisso (diferenciar a exibição de MPs e tópicos nos resultados de busca) e tenho uma solução improvisada pouco elegante funcionando localmente que parece funcionar, mas que provavelmente precisa de bastante refinamento. Devo abrir um tópico separado na categoria dev ou algo assim se achar que não está totalmente pronto para produção, ou devo simplesmente abrir um PR e usá-lo como espaço para discussão?

4 curtidas

Se você tiver algo funcionando, um PR seria ótimo — facilita comentar partes específicas do código. Se quiser, o GitHub tem um novo recurso de “PR Rascunho” (clique na seta ao lado de “criar pull request” antes de enviar).

7 curtidas

OK, parece ótimo, obrigado! Acabei de enviar um PR.

7 curtidas

O ícone foi mesclado agora - obrigado @hartz :slight_smile:

8 curtidas

Este tópico foi automaticamente fechado após 5 dias. Novas respostas não são mais permitidas.