3

I don't see any search options that will return results containing only the tags being searched -- where posts that contain any other tag other than the tags searched will not appear in results. So, if I want to search for posts containing only and , I don't want to see posts that contain , and (or any other tag).

I can choose to do something like the following to get results closer to what I'm looking for but it's tedious and doesn't guarantee the results I'm looking for: [html][css]-[javascript]-[jquery]-[twitter-bootstrap]

I know I can search for exact matches on content within posts containing the tags being searched by surrounding the exact phrase I'd like to match with quotations, but I don't see anything that seems to give equivalent results for tags.

1
  • What will be your use of seeing specific tags? You migh miss relevant questions for example with also css3 tag
    – Ori Marko
    Commented Aug 15, 2017 at 6:04

1 Answer 1

4

Why would you want to do this? What is it that makes you want to see a post tagged with just and but not ? I totally understand the desire to filter out specific tags like or , but the tag system isn't designed to support queries like this.

That said, this SEDE query returns all questions tagged and but nothing else. This question is the first hit:

Is there a best practice when you want an html heading element's content to be displayed over multiple lines?

For reference, here is the complete query; feel free to fork/copy it.

SELECT TOP 100 Id AS [Post Link], Tags, CreationDate
  FROM Posts
  WHERE PostTypeId = 1
    AND Tags = '<html><css>'
  ORDER BY CreationDate DESC

(note that SEDE is refreshed once a week, on Sunday morning)


Further research by @tripleee and me (see the comments) indicates that it can be necessary to search for all permutations of the tags, e.g. you also need to search for <css><html>. For two tags, this is doable, for more tags, it's probably better to write a query involving the Tags table. Anyway, you don't lose much in this case: only older questions ( was more popular than back in 2014) and questions migrated from sites where is more popular than , cf. this question)

7
  • The order of the tags is not guaranteed; you have to search for every permutation. data.stackexchange.com/stackoverflow/revision/710543/884345/…
    – tripleee
    Commented Aug 15, 2017 at 6:17
  • (The TOP 100 obscures the fact that there are hits with the opposite order; but there certainly are such questions.)
    – tripleee
    Commented Aug 15, 2017 at 6:20
  • ? I thought they were in the same (popularity) order as displayed on the site. There are indeed a few questions 'the other way around', that's interesting.
    – Glorfindel
    Commented Aug 15, 2017 at 6:20
  • 1
    The hits for the opposite order are much older; maybe the popularity changed in 2017?
    – tripleee
    Commented Aug 15, 2017 at 6:21
  • 1
    Yeah, I was thinking about that as well (s/2017/2014/). Or they were migrated from a site where CSS is more popular than HTML.
    – Glorfindel
    Commented Aug 15, 2017 at 6:22
  • Just trying to figure out the site and what my search options are. I'm no expert but thought I might try answering some simple html and css questions that aren't overcomplicated by other technology people are using. I still have lots to learn so maybe it's not as useful as I thought.
    – Kevin
    Commented Aug 15, 2017 at 6:36
  • 3
    @Kevin don't worry about it. It is good you asked, it is very good you try to get to learn the quirks and powers of SE search and it is even more wonderful you try to deliver answers on topics you feel comfortable with. If your answers are like your MSO question, I expect you'll do fine. Good luck.
    – rene
    Commented Aug 15, 2017 at 7:56

You must log in to answer this question.

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