Skip to main content
Participant
April 24, 2025
Question

Keyword error creating smart collection in LrC

  • April 24, 2025
  • 3 replies
  • 442 views

Lightroom Classic 14.2. 

Camera Raw 17.2

MacBook Pro M3 Max 64GB

Sequoia 15.3.1

 

Just getting to grips with Smart Collections.  It is mostly intuitive, but I am having problems with keywords that contain spaces and numbers. 

 

As succinctly as I can...  I have images from two shoots that I want to put into separate smart collections.

 

  • There are 430 images from the first shoot and these have been have tagged with the keyword 2019 03 CORNWALL (PENZANCE).
  • There are 176 images in the second shoot and these have been tagged with the keyword 2019 09 CORNWALL (PENZANCE).

 

I created a smart filter for the first shoot, MATCH ALL, KEYWORDS, CONTAINS ALL, 2019 03 CORNWALL (PENZANCE). However, it returns all photos from both shoots (606 images in total), ie the smart filter is picking up images from both shoots.

 

Meanwhile if I create a filter for the second shoot MATCH ALL, KEYWORDS, CONTAINS ALL, 2019 09 CORNWALL (PENZANCE) it correctly returns just the 178 images from this shoot.

 

I checked the images in the folders panel and the keywords are not duplicated. I know this, because I get the correct breakdown if I use the Metadata search panel at the top of the Library window.

 

It seems that Lightroom is confused by the spaces in the keywords and is not distinguishing between 03 and 09, but it is only doing this in one of the searches.

 

I get the correct results by using STARTS WITH instead of CONTAINS ALL, and then entering the relevant keyword string, but this is not an elegant work-around.

 

Any idea what is going on here? 

 

Many thanks in advance for your kind words of wisodom and experience.

 

 

3 replies

johnrellis
Legend
April 25, 2025

"I created a smart filter for the first shoot, MATCH ALL, KEYWORDS, CONTAINS ALL, 2019 03 CORNWALL (PENZANCE). However, it returns all photos from both shoots (606 images in total), ie the smart filter is picking up images from both shoots.

 

Meanwhile if I create a filter for the second shoot MATCH ALL, KEYWORDS, CONTAINS ALL, 2019 09 CORNWALL (PENZANCE) it correctly returns just the 178 images from this shoot."

 

LR's text-matching operators were poorly designed, especially with respect to keywords containing spaces.

 

The criterion "Keywords contains all x1 x2 ... xn" matches a photo if, for each "xi", there is a keyword directly or indirectly assigned to the photo that contains "xi" somewhere in its name.

 

In your example, perhaps the photos assigned the keyword "2019 09 CORNWALL (PENZANCE)" were also assigned "94032".  So the criterion "Keywords contains all 2019 03 CORNWALL (PENZANCE)" matches because each of the strings "2019", "03", "CORNWALL", and "(PENZANCE)" is contained in at least one of the keywords assigned to the photos. 

 

Note that the Keywords criteria examine both keywords directly assigned to the photo and the hierarchical ancestors of those directly assigned keywords.  E.g. "contains all 03" would match the hierarchical keyword "94032 > Newtown".

 

If you don't think this explains what you're observing, the most efficient way to figure out the explanation would be:

 

1. In Library, select several of the photos that are assigned "2019 09 CORNWALL (PENZANCE)".

 

2. Do File > Export As Catalog, selecting just the option Export Selected Photos Only. The actual photos won't be included in the exported catalog, but that's fine.

 

3. Zip up the exported catalog folder and upload the .zip to Wetransfer, Dropbox, Google Drive or similar free service and post the sharing link here.

 

* * *

 

There are various ways to handle LR's design bugs with keyword matching:

 

1. Don't use spaces in your keywords. E.g. use "2019_09_CORNWALL_(PENZANCE)".

 

2. Use the Keyword List and Metadata browser to match exact keywords, as described in the link dj_paige posted above.

 

3. Use the Any Filter plugin, which has operators for matching text exactly.

 

Note that a previous workaround, using:

Match all of the following rules:
    Keywords starts with x
    Keywords ends with x

 

broke in LR 13.3:

https://community.adobe.com/t5/lightroom-classic-bugs/p-starts-with-text-filter-on-captions-or-filename-incorrectly-matches-words/idi-p/14729614

BPH8Author
Participant
April 25, 2025

Thanks for this comprehensive feedback. It is very helpful, as I was trying to understand why I get the correct filter with 2019 09 CORNWALL (PENZANCE), and not with 2019 03 CORNWALL (PENZANCE).

 

If I have understood correctly (admittedly, a big IF), the problem may be because both keywords sit under the same parent keywords

 

WHAT >> VACATION >> 2019 03 CORNWALL (PENZANCE).

 

WHAT >> VACATION >> 2019 09 CORNWALL (PENZANCE) 

 

In the nested hierarchy under VACATION, 2019 03 CORNWALL (PENZANCE) appears above 2019 09 CORNWALL (PENZANCE).  

 

Does this help explain why I get photos from both shoots with the keyword 2019 03 CORNWALL (PENZANCE), and photos from the single desired shoot with keyword 2019 09 CORNWALL (PENZANCE)?

 

Thanks for your patence in helping me to understand, much appreciated.

 

dj_paige
Legend
April 24, 2025

Smart Collection rules do sometimes have problems with multi-word keyword searching. Better is to simply select the keywords you want in the Keyword List panel, then the problem goes away. https://helpx.adobe.com/lightroom-classic/help/finding-photos-catalog.html

 

May I also suggest strongly that dates do not belong in keywords. The metadata containing dates is already in the original photo files, and LrC can work with those. If you had only keyword Cornwall (Penzance), you can still filter by date elsewhere in the Smart Collection definition or in the filter bar.

 

May I also suggest that a better hierarchy is to put the State above the City, such as, so if you want all Cornwall photos, those are easy to obtain from the Cornwall keyword, and if you want only the Penzance photos, you can find them easily using the Penzance keyword. In fact, keywords work better if they refer to a single piece of information, such as the city, rather than multiple pieces of information like you have with city state and date.

 

Cornwall

        Penzance

 

My hierarchy looks like this:

 

 

BPH8Author
Participant
April 25, 2025

Thanks dj_paige

 

That sounds like good advice, to avoid dates in the keyword hierarchy.

 

I do indeed have my location hierarchy set to COUNTRY >> STATE >>. CITY.  So I will try a different search pattern using dates and location instead of my alpha numeric keyword.

 

Thanks again

 

BPH8 

dj_paige
Legend
April 25, 2025
quote

I do indeed have my location hierarchy set to COUNTRY >> STATE >> CITY


By @BPH8

 

 

Then why do you use both Cornwall and Penzance in the same keyword?

Community Manager
April 24, 2025

Hi @BPH8! Welcome to the community!

I tested this out on my end by creating two different smart collections using the same keywords you mentioned: 2019 03 CORNWALL (PENZANCE) and 2019 09 CORNWALL (PENZANCE). For me, they returned the correct photos as expected.


Perhaps one of the keywords got accidentally moved underneath the other in the hierarchy. You can check this by typing the keywords into the Keyword List search box and seeing if it has any child keywords.



 

Another possibility is that a keyword somehow got added as a synonym for the other. In the Keyword List panel, double-click each of the keywords in turn to see if one of them has any synonyms.
Hope this helps! 😊

Alek

*(If you mention me with an @, like @Aleke, I’ll get a notification and can respond faster.)*
BPH8Author
Participant
April 24, 2025

Dear Aleke,

Thank you so much for looking into this

I really wish that I had made a rookie error and accidentally nested 2019 03 CORNWALL (PENZANCE) inside 2019 09 CORNWALL (PENZANCE) as you have shown... I triple checked and sadly this is not the cause.

I also checked the synonyms for both key words.  I have none listed.

So sadly, I am still stumped.

Thanks again

BPH8