7

Is there a way to search for question which contains a specific tag (or set of tag), but no other tags.

For example if I wanted to have only pure [php] questions I would input in the search filed the following:

![php]

Or for question only concerning html and css I would input:

![html+css]

Is there already such a feature hidden in the SO Engine? If not, with the high number of question in SO, I feel like it would be a good feature.

11
  • 1
    Can you give an example where this would be useful? There could be any number of secondary tags on a question, but that doesn't make it any less relevant to a tag search. Unless I'm missing something.
    – CodeNaked
    Commented Sep 8, 2011 at 14:32
  • 1
    You'd have to get people to tag "pure php" questions with only the php tag first. Commented Sep 8, 2011 at 14:38
  • @CodeNaked: That is an idea which came to me when browsing the unanswered question to see if I can find something I could answer. But more often than not, the question are about the subject I know, plus a tool I am not familiar with, or a combination of languages which are individually familiar, however never encountered together. And browsing through the 300.000+ unanswered question can take a long time.
    – Eldros
    Commented Sep 8, 2011 at 14:39
  • @Bill I'm sure there are question which have only one tag, there must be.
    – Eldros
    Commented Sep 8, 2011 at 14:40
  • 1
    There's not too many unanswered, open questions only tagged with php. There are quite a few single tag, open questions, though.
    – Tim Stone
    Commented Sep 8, 2011 at 15:04
  • 1
    A single tag can sometimes be an indicator of low quality, so that kind of search might be useful for pruning purposes.
    – user154510
    Commented Sep 8, 2011 at 15:45
  • @Tim: php was just an example to illustrate my idea.
    – Eldros
    Commented Sep 9, 2011 at 6:52
  • 1
    Your use of "!" would be confusing to some of us, as it often means "not" as in I might read your "![php]" as "all tagged items that are not tagged with "[php]." Commented Sep 9, 2011 at 20:02
  • @John: I admit that it might be confusing, any suggestion as what other symbol could be used in this case?
    – Eldros
    Commented Sep 14, 2011 at 8:20
  • @Tim Stone: I made a few change to your query, to search for the Number of unanswered post with single tag. This and Brock Adams helped me find a few answers where I could at least try to help.
    – Eldros
    Commented Sep 14, 2011 at 8:42
  • I would like to hear the opinion of the person who downvoted this question.
    – Eldros
    Commented Sep 19, 2011 at 8:08

4 Answers 4

4

I do not find any single symbolic way in common use to specify a search only for one particular tag and excluding all others. As mentioned in my earlier comment, I do not approve your recommendation of '!' because it too closely resembles the negation operator used in many modern computer programming languages.

My best guess at a reasonable design is to use the asterisk, '*' to emphasize "only."

Example: type '*[php]' to specify "give me only items tagged with 'php' and nothing else."

This would avoid implying something like the "not" operator in common use.

I would also recommend providing '+' to make a tag required and '-' to prohibit one, including the ability to use multiple plusses and multiple minuses.

Example: '+[php] +[css] -[PDF]' to specify "give me items tagged with '[php]' and '[css]' but not with '[PDF]'.

That syntax is used at Delicious and in Google searches, so it is reasonably intuitive.

1
  • Asterisk in turn might seem similar to wildcard or some kind of fuzzy search or regex/shell-pattern.
    – KarolDepka
    Commented Oct 20, 2016 at 23:50
3

See my answer to "Search for undertagged questions".

You can do this with the Data Explorer if you don't mind data that lags by a month.

Here's a search for questions with only the php tag.

Likewise for only html+css.

1
  • I've found a way to look for questions without the one month tag. Commented Nov 21, 2011 at 2:24
2

I've just noticed that if you do

[php] closed:0

and you sort by relevance, it looks like the first 5000 hits are only tagged with and nothing else.

If you're doing the query to tag under-tagged questions, this has the advantage over Brock's answer of not having the one-month lag.

0
1

If you're wanting to search only for questions about php, but not about frameworks, then do something like

[php] -[zend-framework] -[codeigniter]

That way, you could search for questions that are about pure php, but also happen to mention, say, .

You must log in to answer this question.

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