# Keyword Hierarchy - which is correct?



## Michael Naylor (Aug 16, 2018)

I've recently returned to Lightroom, having wasted so much time believing Media Pro / Capture One would be better - it isn't!    However, it did allow me to sort out some of the organisational mess I'd previously created.  But now I see a problem and hope someone can shed some light on this.






The image shows a fragment of the hierarchy in my Keyword List.    Andalusia, Balearic Islands and every thing else, except Asturias, were created or modified by Media Pro / Capture One.      Asturias is a fresh import to Lightroom direct from the camera.   Note that Asturias does not show the total number of assigned child keywords, but the others do.     The settings for the parents and childs are the same.

My questions are...
1) Should Lightroom display the totals or not?
2) If not, what is causing the totals to be displayed?
3) if yes, why isn't Asturias showing the totals?
4) Has Adobe changed something in the past few months?


----------



## Johan Elzenga (Aug 16, 2018)

Lightroom displays numbers of photos that actually contain this keyword. So there are 17938 photos that actually contain the keyword 'Spain',  but there are no photos that contain the keyword 'Asturias'. There may be photos that contain a sub-keyword of 'Asturias' however. Those photos will no show in the keyword count for the parent keyword.


----------



## Michael Naylor (Aug 16, 2018)

JohanElzenga said:


> Lightroom displays numbers of photos that actually contain this keyword. So there are 17938 photos that actually contain the keyword 'Spain',  but there are no photos that contain the keyword 'Asturias'. There may be photos that contain a sub-keyword of 'Asturias' however. Those photos will no show in the keyword count for the parent keyword.


If I add the keyword Asturias, or any of its children, the Spain count doesn't change.  All keywords above an Asturias child are however being exported.  In other words, having Asturias selected doesn't make any difference to the outcome.   So back to my questions; what is going on here and why are some checked and others not?


----------



## Johan Elzenga (Aug 16, 2018)

Mike Naylor said:


> If I add the keyword Asturias, or any of its children, the Spain count doesn't change.


Yes, that's what I tried to explain. The Spain count is only increased if you really assign the keyword Spain itself, not if you assign only a sub-keyword of Spain. Export of keywords has nothing to do with this. The count only reflects how many images have the keyword itself assigned to them.


----------



## Michael Naylor (Aug 16, 2018)

JohanElzenga said:


> Yes, that's what I tried to explain. The Spain count is only increased if you really assign the keyword Spain itself, not if you assign only a sub-keyword of Spain. Export of keywords has nothing to do with this. The count only reflects how many images have the keyword itself assigned to them.


We are in total agreement, but this doesn't explain why LR ticked the parents of previously imported images which already had keywords - then didn't automatically tick the parents for my latest shoot for which I later created the Asturias keywords.


----------



## Johan Elzenga (Aug 16, 2018)

Mike Naylor said:


> We are in total agreement, but this doesn't explain why LR ticked the parents of previously imported images which already had keywords - then didn't automatically tick the parents for my latest shoot for which I later created the Asturias keywords.


There is no mystery here. Lightroom simply counts those images that have a certain keyword assigned to them and displayes that number, period. So apparently you created the ‘Asturias’ parent keyword, but you *didn’t* assign it to any image. You probably did assign its sub-keywords to some images (but because the parent is collapsed, I can’t confirm that). For previous parent keywords like ‘Spain’, you apparently *did* assign the parent keyword to the images. It’s as simple as that.


----------



## Johan Elzenga (Aug 16, 2018)

BTW, if you filter on keywords, you can change the filter view from hierarchical to ‘flat’. That will show each keyword on its own, and allow you to filter on a keyword on its own. In other words, you can filter on images that contain the keyword ‘Spain’, regardless of any sub-keywords. Try this and you will see that filtering on ‘Spain’ will give you 17938 hits, while filtering on ‘Asturias’ will give you zero hits.


----------



## Michael Naylor (Aug 17, 2018)

Filtering isn't working like that here.  In hierarchical view, the count for Astrurias is blank, but clicking it brings up all 250 images.  In flat view, Asturias doesn't appear at all.  Further more, in hierarchical view many of my other parent keywords  have blank totals, but in the Keyword List panel they do have totals.  This is incredibly confusing for me, as I fail to see any logical reason for this.


----------



## Johan Elzenga (Aug 17, 2018)

Mike Naylor said:


> Filtering isn't working like that here. In hierarchical view, the count for Astrurias is blank, but clicking it brings up all 250 images. In flat view, Asturias doesn't appear at all. Further more, in hierarchical view many of my other parent keywords have blank totals, but in the Keyword List panel they do have totals. This is incredibly confusing for me, as I fail to see any logical reason for this.


Sorry, a small mistake from my side, but it does confirm the idea behind it. In flat view you do not see any keywords that do not have any images assigned to them, because that would be useless. If you know you'll get zero hits anyway when you click on it, then there is no point in displaying it in the first place.

In hierarchical view these keywords must be displayed, because they have sub-keywords. If you click on them, you'll get all the images with one or more of those sub-keywords, but the image count only refers to the number of images that have this parent _assigned_ to them. It really is simple if you just remember what I said from the beginning: the count refers to the number of images that have this particular keyword _assigned_ to them. The count does not take any hierarchical keywords into account (but _clicking_ on the keyword does search on sub-keywords too).


----------



## Michael Naylor (Aug 17, 2018)

I appreciate you're efforts to help, but we've wondered away from my original questions.  I've obviously failed to explain the inconsistency I see, but I can't come up with any other way to explain it. Many thanks.


----------



## Johan Elzenga (Aug 17, 2018)

The 'inconsistency' you see is almost certainly user-related. You probably have assigned certain parent keywords (but perhaps not to all the images that would fit), and not assigned other parent keywords. You can check this the way I explained.


----------



## Michael Naylor (Aug 17, 2018)

You continue to misunderstand the original post.  Lightroom 'randomly' assigned the parent keywords all by itself when I imported 20,000 images that already had keywords within the files.  After the import was done, I manually created the child Asturias under Spain and then added children under Asturias.    It was then that I noticed the inconsistencies.  My original post is merely asking what is causing this anomaly.  If you don't know, then perhaps others reading this thread may.  Otherwise, I'll write it off as being yet another of Lightroom's idiosyncrasies .


----------



## Johan Elzenga (Aug 17, 2018)

*Lightroom does not randomly assign parent keywords all by itself*. It will indeed read and assign keywords that are already in the metadata of the imported images. If these metadata contain a keyword hierarchy, then both the parent and the child get assigned.  If you create a parent manually later, then this parent is not assigned unless you do so yourself.


----------



## Wernfried (Aug 17, 2018)

Do you have keyword "Asturias" anywhere else in your Keyword hierarchy? Perhaps you have it twice and you just mixed them up.
Do you have any sub-keyword underneath Asturias?

But in general importing keywords could be a problem, see Lightroom Classic: Zombie keywords can't be deleted | Photoshop Family Customer Community

Wernfried


----------



## PhilBurton (Aug 17, 2018)

JohanElzenga said:


> Sorry, a small mistake from my side, but it does confirm the idea behind it. In flat view you do not see any keywords that do not have any images assigned to them, because that would be useless. If you know you'll get zero hits anyway when you click on it, then there is no point in displaying it in the first place.
> 
> In hierarchical view these keywords must be displayed, because they have sub-keywords. If you click on them, you'll get all the images with one or more of those sub-keywords, but the image count only refers to the number of images that have this parent _assigned_ to them. It really is simple if you just remember what I said from the beginning: the count refers to the number of images that have this particular keyword _assigned_ to them. The count does not take any hierarchical keywords into account (but _clicking_ on the keyword does search on sub-keywords too).


Johan,

Consider the inconsistency with Import.  I use a YYYY/MM/DD date-based system for folder organization.  In this example, I would be importing 14 photos from 15 September 2016:





The imported photos would go into folder 2016/09/15, but Lightroom shows image counts for the parent directories.

I think Mike's expectation passes the "sniff test."  Mike, maybe you should submit a feature request to Adobe to display image counts for parent keywords, at least as a configurable option.

Phil Burton


----------



## prbimages (Aug 18, 2018)

A related question, if I may:

I have a keyword hierarchy for location, and my "Australia" keyword shows a count of "1". Below that, I have thousands of images in various locations in Australia, with various associated keywords. I understand what Johan is saying, that at some point the keyword "Australia" was tagged on a single photo, rather than being tagged via a lower-level keyword. My question is, how do I find this single, inconsistently-keyworded image? If I click on the arrow to the right of the keyword, I get everything keyworded "Australia" (which is what I would normally want). How to isolate that one image?


----------



## Jim Wilde (Aug 18, 2018)

prbimages said:


> A related question, if I may:
> 
> I have a keyword hierarchy for location, and my "Australia" keyword shows a count of "1". Below that, I have thousands of images in various locations in Australia, with various associated keywords. I understand what Johan is saying, that at some point the keyword "Australia" was tagged on a single photo, rather than being tagged via a lower-level keyword. My question is, how do I find this single, inconsistently-keyworded image? If I click on the arrow to the right of the keyword, I get everything keyworded "Australia" (which is what I would normally want). How to isolate that one image?



Johan explained how to do this in post #7.....basically use the Library Filter>Metadata>Keywords (select All Photographs first), then click on the small icon at the right-hand end of the Keywords header, and in the sub-menu that appears select "Flat" ("Hierarchical" is the default). That will list all the keywords that have been *directly* *assigned* to images, so you should see the Australia keyword appear with a total of just one. Select it and there's the culprit....


----------



## Johan Elzenga (Aug 18, 2018)

OK Mike,

Allow me to correct my mistake by giving you this explanation of the inconsistencies you see:

Let's assume you import four images, two of them taken in Madrid and two taken in Barcelona. These images already have (hierarchical) keywords in their metadata. The Madrid images contain the keywords Spain and Madrid, the Barcelona images contain the keywords Spain and Barcelona. So after they have been imported you will see the parent keyword Spain with an image count of 4, and the child keywords Madrid and Barcelona with each an image count of 2. So far, so good.

Now you take another photo in Madrid. You import this photo in Lightroom, and because it comes straight out of your camera it does not have any keywords yet. You assign the keyword Madrid to it. So now you will see that the keyword Madrid has an image count of 3, but Spain still has an image count of 4, not 5! That seems illogical, but because that number represents the images with the keyword Spain *assigned* to them it is correct. You did not assign the parent keyword Spain to this new image, so the number of images with Spain assigned to them is still 4, not 5.

When you *search* on the keyword Spain, Lightroom will show you *5* images! That does indeed seem inconsistent, but it is not. When searching, Lightroom takes child keywords into account and that is logical. Any image with the keyword Madrid must have been shot in Spain, so Lightroom will find the new image too when you search on Spain, even though you did not assign that keyword to it.

The new Asturias parent does not have any image count, because you only created that keyword in the list and moved other keywords below it. You (apparently) did not *assign* it to any image however, and Lightroom does not do that either when you move other keywords below it. You’d have to do that manually and you didn’t. It may be assigned on export, but that is a separate function.

I hope I understood (and explained) the question this time.


----------



## Michael Naylor (Aug 18, 2018)

JohanElzenga said:


> Allow me to correct my mistake by giving you this explanation of the inconsistencies you see


Hi Johan, and thank you for looking into this.   This is exactly what I've been experiencing, so I'm relieved to hear I can move forward knowing its not some kind of corruption.  

I'm a stickler for consistency, so I'll need to decide whether to tick-the-unticked or untick-the-ticked, in order to make them all look the same.   Maybe a future version will bring it into line with the way the folder counts are displayed.


----------



## prbimages (Aug 19, 2018)

Jim Wilde said:


> Johan explained how to do this in post #7.....basically use the Library Filter>Metadata>Keywords (select All Photographs first), then ...


Thanks Jim, this detailed explanation was exactly what I needed


----------



## coachejp (Jun 7, 2019)

Jim Wilde said:


> Johan explained how to do this in post #7.....basically use the Library Filter>Metadata>Keywords (select All Photographs first), then click on the small icon at the right-hand end of the Keywords header, and in the sub-menu that appears select "Flat" ("Hierarchical" is the default). That will list all the keywords that have been *directly* *assigned* to images, so you should see the Australia keyword appear with a total of just one. Select it and there's the culprit....


I'm going to take this conversation to another level.I hope it is up and not down. What is going on if you put the Keyword list in flat mode and then it goes back to hierarchy by itself?  Thanks EJ


----------



## Califdan (Jun 7, 2019)

Are you talking about the keyword list that is part of the metadata filter (above the grid)?   Or the Keyword List Panel on the right?   

In the case of the Keyword List panel on the right, I don't believe there is a flat vs hierarchical mode.  If you enter KW's as a hierarchy then it is hierarchical if you enter all keywords at the top level then it is flat.  

In the case of the list in the metadata filter, you can toggle back and forth between flat and hierarchical at will and it will refresh based on what is in the Keyword List panel (all keywords).  So, if you changed it to flat and come back at some other time and it is hierarchical, then just toggle it back to flat and vice versa.


----------

