23

When searching for example for this, I get multiple results that do not have both tags, but just one of them:

https://stackoverflow.com/unanswered/tagged/php+oop returns: search results for https://stackoverflow.com/unanswered/tagged/php+oop

And:

results count

Other searches with similiar results.

But for example, this, seems to work.

Has the behavior for multi tag search changed, or is it broken? (Or is it me that didn't understand how the feature works? :P )

5

3 Answers 3

22

There's some history here around whether pages specifying multiple tags should work as unions or intersections (by default). It isn't consistent, and there are some glitches with changing tabs, and with the tag-cloud that appends tags to the url. It isn't perfect, I'll be honest.

However, if you're explicit, it'll always work as you expect:

http://stackoverflow.com/unanswered/tagged/php+and+oop

vs

http://stackoverflow.com/unanswered/tagged/php+or+oop

The same applies to the other pages, like:

http://stackoverflow.com/questions/tagged/php+and+oop

vs

http://stackoverflow.com/questions/tagged/php+or+oop
13
  • 1
    Yup. If I use stackoverflow.com/questions/tagged/php+and+oop, it'll redirect me to stackoverflow.com/questions/tagged/php, but with stackoverflow.com/unanswered/tagged/php+and+oop it appears to work.
    – yivi
    Commented Feb 2, 2017 at 13:22
  • 1
    Again, with "questions", it just redirects me. :P
    – yivi
    Commented Feb 2, 2017 at 13:24
  • @yivi you shouldn't be redirected unless you are anonymous (we block multi-tag searches) - can you confirm that you're logged in and are being redirected? Commented Feb 2, 2017 at 13:24
  • 1
    @yivi I should also note that our "anonymous single tag only redirect" thing relates to a bot attack years ago, on a completely different tag-engine implementation; I'll see whether we might want to reverse that... Commented Feb 2, 2017 at 13:25
  • Sorry, I was purposely trying as anoymous to verify there was no nothing in my session that was influencing the results. :)
    – yivi
    Commented Feb 2, 2017 at 13:25
  • As an authenticated user, it seems to work as you say.
    – yivi
    Commented Feb 2, 2017 at 13:33
  • 5
    @yivi in about 3 minutes, anonymous users will be able to use 3 tags at a time (easily configurable if we want to change the number) Commented Feb 2, 2017 at 14:01
  • Wondrous. Not that I browse SO anonymously so often, but still, nice to feel that you guys are paying attention. :)
    – yivi
    Commented Feb 2, 2017 at 14:05
  • 1
    @MarcGravell What's the reasoning behind blocking anonymous users from multi-tag searches?
    – TylerH
    Commented Feb 2, 2017 at 14:29
  • @TylerH at the time we added that, we were under sustained hammering from badly behaved crawlers; multi-tag was very rarely used by "real" anons, and was disproportionately expensive. Was causing pain. We've completely rewritten the code underneath all that now, so happy to see how it behaves as we loosen it Commented Feb 2, 2017 at 15:09
  • 6
    I see that you applied the "status-bydesign" tag. Is it really "by design" that the tag search has glitches that causes it to defy expectations? As I commented on another answer, the exact same search query being interpreted differently on different tabs is, as far as I'm concerned, a bug, either in the code or in the UI. I don't think this should be by design. It may be that you're afraid to touch this code and break something else, or it may just not be high priority to fix, but this certainly doesn't seem like something that should be "by design" to me.
    – Cody Gray Mod
    Commented Feb 3, 2017 at 5:13
  • @CodyGray it is "by design" in at least as much as I've raised this topic in our internal chat a few months ago, discussed it at length with various teams, and we concluded that we wish to leave it "as is" at the current time. It is an active, not passive, position. Commented Feb 3, 2017 at 7:48
  • 4
    Any insight that you can provide on the rationale for that decision? Your answer doesn't give much of a clue. I've been confused by this behavior several times, so while I welcome the workaround you've suggested, the position being taken seems (at least from the outside looking in) illogical.
    – Cody Gray Mod
    Commented Feb 3, 2017 at 7:51
6

In addition to Marc's suggestion, you can get the search to show questions with both and by toggling the switch between "any" and "all" on the right edge of the search bar:

enter image description here

However, you may have to wait a bit to use those buttons; for some reason, they only show up after a new question has been posted, and you see the "1 new question" alert bar at the top of the list.

If you can't see it and don't want to wait, the URL is: https://stackoverflow.com/questions/tagged/php%20oop?filter=need-answers&mode=all

2
  • 2
    Only if you're using the "new navigation" stuff, which as far as I can tell, is still in beta. (Not promising, btw, to have a beta last this long, Gmail notwithstanding.)
    – Cody Gray Mod
    Commented Feb 3, 2017 at 5:14
  • @CodyGray yeah, I am a bit surprised to learn that not everyone is on that navigation view by now... I thought they were.
    – TylerH
    Commented Feb 3, 2017 at 14:13
2

If you go through the unanswered tab, it works as a or (tag1 || tag2). This is the way you make your research.

Note you can see it on the URL:

http://stackoverflow.com/unanswered/tagged/php+oop
                         ^^^^^^^^^^

However, it displays only tag1 && tag2 questions if you select the questions tab.

http://stackoverflow.com/questions/tagged/php+oop
                         ^^^^^^^^^

enter image description here


It could be a bug, but working with URL seems to returns the expected results.

11
  • Now I see that the actual link includes unanswered as part of the URL, but that that part is ignored in tab selection... Besides that, even changing tabs I see that the results are filtered with ||, not with &&. I don't know if its a bug or a feature unless I know what would be the intended behavior.
    – yivi
    Commented Feb 2, 2017 at 12:41
  • @yivi Read again my answer please. The difference is in the URL: unanswered is ||. questions is &&.
    – Mistalis
    Commented Feb 2, 2017 at 12:46
  • 2
    The exact same search query being interpreted differently on different tabs is definitely a bug.
    – Cody Gray Mod
    Commented Feb 2, 2017 at 12:51
  • I can't replicate your results, sorry. But even if behaved that way, it would be faulty to me. I mostly agree with @cody-gray: same query should return the same results, unless documented somewhere than it wont. But the more I play with the search interface and its tabs, the more inconsistent I find it. But a week or two ago, it seemed to me that the multi-tag filter was working...
    – yivi
    Commented Feb 2, 2017 at 13:01
  • @yivi http://stackoverflow.com/questions/tagged/php+oop works, http://stackoverflow.com/unanswered/tagged/php+oopdoes not works.
    – Mistalis
    Commented Feb 2, 2017 at 13:05
  • Not for me. When I try the first one, it redirects me to stackoverflow.com/questions/tagged/php
    – yivi
    Commented Feb 2, 2017 at 13:06
  • @yivi The first URL returns the correct results for me: i.sstatic.net/jfciG.png
    – Mistalis
    Commented Feb 2, 2017 at 13:08
  • Not for me. It redirects me. Tried FF, FF for developers, and chrome. Private sessions with empty cookies. Will redirect me to stackoverflow.com/questions/tagged/php
    – yivi
    Commented Feb 2, 2017 at 13:10
  • 1
    And again, it would still be a bug for me if that was the answer.
    – yivi
    Commented Feb 2, 2017 at 13:11
  • i.imgur.com/o34RgPl.png
    – yivi
    Commented Feb 2, 2017 at 13:18
  • i.sstatic.net/IzONY.png
    – Mistalis
    Commented Feb 2, 2017 at 13:23

You must log in to answer this question.

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