3

My inbox contains the following emails:

(a) John (0)     label:XY label:XY/Z
(b) Mary (0)     label:XY label:XY/Z
(c) Zack, me (5) label:XY label:XY/Z

where (0) indicates that I have not yet answered emails (a) and (b), while (5) indicates that 'Zack' and myself have already exchanged a bunch of emails.

When I type

label:XY-Z in:inbox

… in order to find all emails with sub-label Z, which is nested under label XY, Gmail finds only emails (a) and (b).

Why does Gmail fail at finding conversations with nested labels?

The problem only occurs for conversations (i.e. emails to which I have already answered), and does not occur when I search for the 'main' label XY instead:

label:XY in:inbox

My XY and Z labels are made only of uppercase letters.

Any help would be very much appreciated.

4 Answers 4

1

I think the nested labels thing here is a bit of a red herring and in fact your problem is, as is a bit buried in the comments on one of the other answers, that labels are applied to messages rather than conversations.

A problem I've had before is that I've applied a label to the messages at a previous point in the conversation and then archived the conversation. Then when a new message came in, the conversation reappeared in the Inbox, but the new message itself was not labelled. So when I searched for the label and in:inbox, there was no matching message that had that label and was also in the Inbox - there were only archived messages with the label, and an unlabelled message in the Inbox. Gmail's UI doesn't make this at all clear and very much implies everything in the conversation has the label.

So in this case, why do you see everything when you search for the parent label, but not when you search for the sub-label? My theory is that you reapplied the parent label to the conversation since the latest message, but not the sub-label. Obviously I could be wrong, but the symptoms fit.

To get round this problem of partially labelled conversations, a very manual workaround is to select the conversation, delete the label and then reapply it, which then labels all the messages. But obviously this is only useful once you've spotted the problem on a particular conversation, so it can't help you find conversations that may have this issue.

What you can do to make sure your search will find everything, however, is reapply the label to all the partially labelled conversations. Courtesy of this answer on a different question, select the label from the list on the left (or search for it manually), select all the conversations, then drag the label onto them from the list on the left.

1

Here are a few things you can try, although I admit it's tough to recreate the scenario you describe.

  1. You mention that the problem seems to exist only for emails you have already answered. Are you sure that the in:Inbox search term isn't the problem? If you have responded and Archived the email thread, then it won't return when searching for in:Inbox
  2. You can try using the left-hand menu to see what Gmail uses as its search term, maybe it's different than what you're entering? In the left-hand menu, you should be able to navigate to the label you're searching for. Clicking on the label name (either the parent or the child label) will pull up all the emails AND throw the search term into the search box. You can try clicking on the label name in the left-side and then appending in:Inbox to that and see if the problem still exists.
  3. Last thing you can try is this: it looks like Gmail formats its nested label text as "XY/Z." Searching for that also produced the expected results when I tried in my own Gmail. Search for label:xy/z in:inbox and it seems like it pulled up what I was expecting. Maybe using the "/" instead of the "-" would work.

Good luck!

1
  • Thanks for your comments. The problem is indeed hard to reproduce. (1) I am certain the conversations are not archived. (2) Clicking the label is how I usually get it into the searchbox. (3) Sadly, substituting / into the request does not solve the issue.
    – Fr.
    May 1, 2019 at 19:01
1
  1. Run the search without in:inbox When I did this on a nested label here, I got more messages. Apparently I archived some of them.

  2. Are the missing emails present without a search?

  3. From your text example above, all these messages also have tag XY. Does this problem occur when you search for messages XY. If it doesn't then a work around is to create a new top level label Z. If it does, then the question should be edited.

  4. Is this problem general to nested labels?

    • If it isn't change the name of XY/Z to something else.

    • Do you use filters extensively? If so, export your filters to a text file, and check labels for weird characters. E.g. a label as an embedded non printing character. You will need to use a text editor that shows ascii or unicode sequences for non-printing characters.

  5. Try the following sequence:

    • Create a new label AB.
    • Create a nested label C
    • Apply AB and AB/C to a set of messages that have this problem.
    • Do your search for them.

If this works, it's more evidence that something is wonky with the actual string that is in the label.

  • Create a new nested label W under XY.
  • Apply it to a set of messages that have this problem.
  • Do your search for XY/W

If this works, then the problem is in Z.


Labels are applied to individual messages, but show up in in conversation view as being OR'd together. This gives rise to some non-intuitive behaviour.

If I search for label:xy I get all conversations where at least ONE message has label:xy on it.

If I search for label:xy and -label:xy I can get a lot of messages. This struck me as odd the first time I ran into it. Two exclusive terms should have given me nothing. In single message view it does. In conversation view I finds all conversations that have one message with and at least one message without label:xy.

The behaviour you describe would be consistent with incoming messages picking up a faux Z label but later messages have a correct Z label. (Faux meaning the Z had a non-printing character, or was actually labeled with a different unicode letter that prints as "Z"

So that brings up another possible check:

  1. Look through your label list on the left of the screen, and see if there is more than one XY/Z. Might not be adjacent to the real one.
1
  • Thanks for your comments. The problem is indeed hard to reproduce. (1) I am certain the conversations are not archived. (2) Yes. (3+4) The problem does indeed affect only nested labels, but I'd like to keep them nested: I use ~ 50 (sub)labels. (5) Does not work, sadly. As said, my label is just uppercase letters. You are right, however, as is one other answer, about the strangeness involved by the fact that labels are assigned to messages, not entire threads -- which might be the issue. (6) Only one label XY, yes.
    – Fr.
    May 1, 2019 at 19:04
0

Your issue lies in the fact that the "-" sign is used by Gmail as a search operator.

Please have a look at this link.
Search operators you can use with Gmail

+-----------------------------------+---------------------------+
|      What you can search by       | Search operator & example |
+-----------------------------------+---------------------------+
| Remove messages from your results | -                         |
|                                   | Example: dinner -movie    |
+-----------------------------------+---------------------------+

So, using your syntax, what you are actually asking, is for all messages under the sub-label Z to be to excluded from your search.

When it comes to labels the recommended way is:

+------------------------------------+---------------------------+
|       What you can search by       | Search operator & example |
+------------------------------------+---------------------------+
| Messages that have a certain label | label:                    |
|                                    | Example: label:friends    |
+------------------------------------+---------------------------+

enter image description here

Please have a look at the following images as well and notice the difference.

Top search bar while in the inbox

enter image description here

And now top search bar while in the label

enter image description here

Note: Labels are only added to a message, and not an entire conversation.


Furthermore, I am a bit confused by your provided example:

(a) John (0)     label:XY label:XY/Z
(b) Mary (0)     label:XY label:XY/Z
(c) Zack, me (5) label:XY label:XY/Z

where (0) indicates that I have not yet answered emails (a) and (b), while (5) indicates that 'Zack' and myself have already exchanged a bunch of emails.

Depending on where the numbers appear -most likely under Settings /Labels- (0) indicates that you have (0) conversations, while (5) indicates that there are (5) conversations that you have exchanged with 'Zack' (within a bunch of emails under that label).
On the other hand, if the (5) appears on the left sidebar next to a label it indicates that there are (5) unread emails among the ones you have exchanged with 'Zack' (within a bunch of conversations under that label). But then you wouldn't see any (0)'s on the sidebar.


EDIT (following your comments)

" You are right, ...labels are apparently assigned to messages, not (as suggested by the Gmail UI) entire conversations/threads..."

Please go to your Sent emails and check whether you have assigned to your specific sent emails ("emails to which I have already answered") XY or Z labels.

In addition, as you can see the above screenshots, rather than typing -Z or Z, type XY instead. This brings up label XY/Z as well.

Also. As you can see in the image bellow, when typing just -Z Gmail presents a few thousand results. So it treats it as the letter Z.

just-Z

Final words. If nothing works, save your sanity by changing Z to ZAA or something. After all they are just labels. Your labels. They are there to make your life easier.

9
  • You are correct, the zeros do not show up: I added them only to indicate that the conversation contained 0 replies from me. As for the suggested solution, it does not work: as your last screenshot shows, selecting label XY/Z in the Gmail search bar automatically translates / to - in the search box. You would be right if I were typing label:XY -Z, which I am not.
    – Fr.
    May 1, 2019 at 18:59
  • … You are right, however, as is one other answer, about the strange fact that labels are apparently assigned to messages, not (as suggested by the Gmail UI) entire conversations/threads -- which might be causing the issue.
    – Fr.
    May 1, 2019 at 19:33
  • 1
    This is incorrect: Google accepts label:XY-Z as being equivalent to label:XY/Z Minus only acts as a NOT operator when it follows white space or start of line. May 2, 2019 at 21:32
  • @SherwoodBotsford "This is incorrect: Google accepts ... start of line." I agree with you and never suggested otherwise. On the contrary. I mention that "when typing just -Z Gmail presents a few thousand results. So it treats it as the letter Z" and the uploaded last image clearly shows it. May 3, 2019 at 16:40
  • @Fr. Have you tried "changing Z to ZAA or something" ? If not please try it (you can always change it back). If so what happened? Do you use the same pattern for other labels as well (Patrick/XY/Z)? May 3, 2019 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.