-2

When I search for the ruby tag a lot of the time I get stuff about ruby on rails which I actually don't want. Should there be a way to specify tags you really really don't want to have? Not just one but many, if possible

11
  • Search [ruby] -[ruby-on-rails] .. Commented Mar 24, 2016 at 21:16
  • nice argument, though I'm interested is it referenced in the faq? Commented Mar 24, 2016 at 21:17
  • stackoverflow.com/help/searching Commented Mar 24, 2016 at 21:18
  • @PeterDavidCarter Yes. "while [laurel] -[hardy] includes only posts pertaining to the first half of the classic comedy couple."*
    – Paul Roub
    Commented Mar 24, 2016 at 21:18
  • fair point; suggest post as duplicate and for possible deletion Commented Mar 24, 2016 at 21:18
  • From the Help Center (Which Bhargav Rao links): "To exclude results from a tag, term or phrase, prefix it with - in your query: waffles -unicorns finds posts that mention tasty batter-based breakfasts without including mythical creatures, while [laurel] -[hardy] includes only posts pertaining to the first half of the classic comedy couple."
    – Kendra
    Commented Mar 24, 2016 at 21:19
  • Also Can I search posts which has TagA but does not have TagB?
    – ryanyuyu
    Commented Mar 24, 2016 at 21:20
  • perhaps we need to make the info more prominent for newbies? Commented Mar 24, 2016 at 21:20
  • 1
    You seem to have edited this into a substantially different question. Are you now asking for a way to exclude multiple tags with less punctuation?
    – Paul Roub
    Commented Mar 24, 2016 at 21:23
  • No really. The question remains I just extended it a bit based on feedback. Commented Mar 24, 2016 at 21:26
  • Same answers, same duplicate(s), then. [tagiwant] -[donotwant] -[northis]
    – Paul Roub
    Commented Mar 24, 2016 at 21:28

1 Answer 1

0

You can use a combination of the - (exclusion) and * (wildcard) operators to ignore a set of tags. For example, if you want questions tagged with but not tagged with any other tag beginning with the prefix ruby-, then you could use the search:

[ruby] -[ruby-*]

After submission, this gets expanded into the search

[ruby] -[ruby-on-rails] -[ruby-on-rails-3] -[ruby-on-rails-4] -[ruby-on-rails-3.2] -[ruby-on-rails-3.1] -[ruby-on-rails-plugins] -[ruby-on-rails-2] -[ruby-on-rails-4.2] -[ruby-1.9.3] -[ruby-on-rails-4.1] -[ruby-2.0] -[ruby-1.9] -[ruby-datamapper] -[ruby-1.9.2] -[ruby-1.8.7] -[ruby-2.1] -[ruby-debug] -[ruby-on-rails-5] -[ruby-c-extension] -[ruby-1.8]

Results of the example

4
  • I mostly just click the 'tags' thing then click ruby Commented Mar 24, 2016 at 21:36
  • Are you using a shell? Commented Mar 24, 2016 at 21:36
  • @PeterDavidCarter shell? It's the search box in the upper right corner.
    – ryanyuyu
    Commented Mar 24, 2016 at 21:40
  • Ah ha! I see... Commented Mar 24, 2016 at 21:42

Not the answer you're looking for? Browse other questions tagged .