Answers.Body: <p>The tags hierarchy are only used as a way to visually cluster them, but they are separate, and if you search on a parent tag, you won't get the contacts that are tagged with a child tag. Perhaps unexpected for you, but some organisations are using it with the parent tag being a kind of "unspecified/other", for instance having a parent tag "media" and children tags "TV", "blog", "newspaper": if one contact is tagged "media", it means "other media", ie. not TV, blog or newspaper. </p>
  
  <p>This is different than the groups, where if you search on a parent group, it will include all the contacts that belong to one of its child group</p>
  
  <p>As of why you got got the contacts tagged with a child tag of parent A... it might be the behaviour you want, but IMO it's a bug and shouldn't behave that way.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T21:15:00.657Z
Answers.LastActivityDate: 2018-04-23T21:15:00.657Z
Answers.UserDisplayName: Xavier
Body: <p>In using tags and creating searches based on tags - I have run into some issues.</p>
  
  <p>Tag Tree Example</p>
  
  <pre><code>Tag Set 1
       Parent A
            Child A1
               Child A1a
               Child A1b
                   Child A1ba
                   Child A1bb 
               Child A1c 
            Child A2
        Parent B
            Child B1
               Child B1a
               Child B1b
               Child B1c
  </code></pre>
  
  <p>In the above example - when I search for anyone tagged Parent A, I get every contact tagged Parent A and I get every contact tagged with any of the Children of Parent A.  This is what we want, so its great.  However, if I do a search for Child A1, I only get results for Child A1 and not the tags that Child A1 is the parent of.</p>
  
  <p>Is this the correct behavior?  Can we change it?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-06T17:30:47.633Z
Comments.Text: IMO this is NOT correct behavior.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-09T15:31:38.067Z
Comments.Text: @JonG-MegaphoneTech Is the correct behavior that Parent and Child Tags have no affiliation with each other, other than display? Or is the correct behavior that contacts with Child tags should appear when searching the Parent tag. Or is it non of the above?!
Comments.UserDisplayName: themak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-09T16:28:58.703Z
Comments.Text: I would expect the latter - but either way is more internally consistent than the current behavior.  If parent/child tags had no affiliation with each other I'd be disappointed but assume there was a good reason.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-10T00:34:06.913Z
Comments.Text: Are your tags named in such a way that it might actually be picking up string comparison instead of parent-child? A quick glance at the code suggests it's using LIKE, so it will match any tag that contains the search term, which might be mistaken for parent-child if they are named similarly. In other words, I'm not sure it's actually doing any parent-child querying. A quick test on the public demo suggests it doesn't normally return results for child tags. What version are you using and how are you searching?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-12T04:38:24.983Z
Comments.Text: Super disappointing - I saw that in the demo - Ill have to retest again - maybe in future there will be a change. So the word now is Parent and Child Tags have no affiliation with each other, other than how tags are displayed.
Comments.UserDisplayName: themak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-14T23:01:08.153Z
Comments.Text: @Demerit I think your comment should be the accepted answer.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-15T02:51:45.353Z
Comments.Text: I didn't post as answer because it wasn't a full look through the code or thorough testing and it really just prompted me to ask for more info about the config. And I didn't fully check what it actually is doing. But I appreciate the comment. My real problem right now is my Leafs can't seem to deal with Boston's top line.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-17T16:10:59.127Z
Comments.Text: I only have 11 minutes to award bounty! @JonG-MegaphoneTech @demerit!
Comments.UserDisplayName: themak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-17T16:49:19.417Z
Comments.Text: or as soon as possible - free reputation to whoever answers.
Comments.UserDisplayName: themak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-19T00:24:24.647Z
Comments.Text: Pardon my ignorance, but why would a tag search of a child tag to also pick up everyone tagged in a parent? That would make being able to search by the child tag useless.
Comments.UserDisplayName: Christia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-19T02:14:00.103Z
Comments.Text: @Christia Thats not what is being questioned. The desired outcome is when parent tags are searched for - all contacts with children tags will also be included in results.
Comments.UserDisplayName: themak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-19T03:13:10.167Z
Comments.Text: But your confusion may stem from the fact that children can be parents of other children. ;)
Comments.UserDisplayName: themak
Tags: <contacts><tags>
Title: Behavior of Tags
ThreadText: # Behavior of Tags
  
  (Asked by: username_0 on 2018-04-04)
  
  In using tags and creating searches based on tags - I have run into some issues.
  
  Tag Tree Example
  
  ```
  Tag Set 1
       Parent A
            Child A1
               Child A1a
               Child A1b
                   Child A1ba
                   Child A1bb 
               Child A1c 
            Child A2
        Parent B
            Child B1
               Child B1a
               Child B1b
               Child B1c
  
  ```
  
  In the above example - when I search for anyone tagged Parent A, I get every contact tagged Parent A and I get every contact tagged with any of the Children of Parent A. This is what we want, so its great. However, if I do a search for Child A1, I only get results for Child A1 and not the tags that Child A1 is the parent of.
  
  Is this the correct behavior? Can we change it?
  
  **Tags:** contacts, tags
  
  > **Comments:**
  > **username_1**: IMO this is NOT correct behavior.  
  > **username_0**: @username_1 Is the correct behavior that Parent and Child Tags have no affiliation with each other, other than display? Or is the correct behavior that contacts with Child tags should appear when searching the Parent tag. Or is it non of the above?!  
  > **username_1**: I would expect the latter - but either way is more internally consistent than the current behavior.  If parent/child tags had no affiliation with each other I'd be disappointed but assume there was a good reason.  
  > **username_2**: Are your tags named in such a way that it might actually be picking up string comparison instead of parent-child? A quick glance at the code suggests it's using LIKE, so it will match any tag that contains the search term, which might be mistaken for parent-child if they are named similarly. In other words, I'm not sure it's actually doing any parent-child querying. A quick test on the public demo suggests it doesn't normally return results for child tags. What version are you using and how are you searching?  
  > **username_0**: Super disappointing - I saw that in the demo - Ill have to retest again - maybe in future there will be a change. So the word now is Parent and Child Tags have no affiliation with each other, other than how tags are displayed.  
  > **username_1**: @username_2 I think your comment should be the accepted answer.  
  > **username_2**: I didn't post as answer because it wasn't a full look through the code or thorough testing and it really just prompted me to ask for more info about the config. And I didn't fully check what it actually is doing. But I appreciate the comment. My real problem right now is my Leafs can't seem to deal with Boston's top line.  
  > **username_0**: I only have 11 minutes to award bounty! @username_1 @username_2!  
  > **username_0**: or as soon as possible - free reputation to whoever answers.  
  > **username_3**: Pardon my ignorance, but why would a tag search of a child tag to also pick up everyone tagged in a parent? That would make being able to search by the child tag useless.  
  > **username_0**: @username_3 Thats not what is being questioned. The desired outcome is when parent tags are searched for - all contacts with children tags will also be included in results.  
  > **username_0**: But your confusion may stem from the fact that children can be parents of other children. ;)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2018-04-23. Score: 3
  
  The tags hierarchy are only used as a way to visually cluster them, but they are separate, and if you search on a parent tag, you won't get the contacts that are tagged with a child tag. Perhaps unexpected for you, but some organisations are using it with the parent tag being a kind of "unspecified/other", for instance having a parent tag "media" and children tags "TV", "blog", "newspaper": if one contact is tagged "media", it means "other media", ie. not TV, blog or newspaper.
  
  This is different than the groups, where if you search on a parent group, it will include all the contacts that belong to one of its child group
  
  As of why you got got the contacts tagged with a child tag of parent A... it might be the behaviour you want, but IMO it's a bug and shouldn't behave that way.
  
  
  ---
  
  