21

I am trying to search for specific tags but excluding others. I have reviewed this question and the search help page but am running into an issue combining the OR operator with excluding tags.

When I run this search:

[java] -[android]

I get expected results with the [java] tag being present and [android] excluded.

However, if I want to search for either the [java] OR [javafx] tags but still exclude [android], it fails and includes [android] questions:

[java] or [javafx] -[android]

This issue does not seem to affect the AND operator as this yields expected results as well:

[java] and [javafx] -[android]

Could someone explain why and how to work around it?

6
  • I think that was only possible with the new-nav that is now gone.
    – rene
    Commented Jun 15, 2018 at 20:45
  • If your search goal allows for having stale data for up to a week, you can use SEDE: data.stackexchange.com/stackoverflow/query/863359
    – rene
    Commented Jun 15, 2018 at 20:57
  • 3
    My goal isn't to have stale data, but to filter the questions to ones I could actually help with.
    – Zephyr
    Commented Jun 15, 2018 at 20:58
  • Your only hope is the Stack API then: api.stackexchange.com/docs/… but you'll have to do an aggregate of results yourself
    – rene
    Commented Jun 15, 2018 at 21:01
  • Seems strange they would remove that functionality but not update their help section; bummer. Thanks for the info, though.
    – Zephyr
    Commented Jun 15, 2018 at 21:03
  • 2
    [java] -[android] or [javafx] -[android] seems to work
    – André
    Commented Jun 18, 2018 at 15:01

1 Answer 1

24

With a small change this search excludes [android].

[java] or [javafx] -[android] is:q

2
  • 5
    Interesting ... so the query language does support this, but with a minor tweak. Seems like a design flaw or a bug to me. Thank you, @niton!
    – Zephyr
    Commented Jun 16, 2018 at 0:31
  • This has been around for a while: meta.stackexchange.com/questions/289388/… - essentially, the solution is to use some operator that doesn't work for tag filters, thus falling back on the full search engine. It would be nice to make this a bit more seamless.
    – Shog9
    Commented Jun 26, 2018 at 21:42

You must log in to answer this question.

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