• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.

Did I finally crack it?...

Joined
Jul 2, 2015
Messages
8,707
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
Classic 7
Lightroom Version
Any version of Lightroom Classic or earlier
Operating System
Other (please note in thread)
You may remember the famous 'John Smith' keyword problem, discussed here many times. Imagine you have three people, called 'John Smith', 'Jane Smith' and 'John Jones'. You want to create a smart collection that searches for images of John Smith. The problem is that 'Contains John Smith' or 'Contains Words John Smith' does not work, because this wil also find images of Jane Smith and John Jones together. Adding a line 'Does not contain Jones' does not work either, because you may have images of John Smith and John Jones together, and these will now be excluded.

Recently we thought that we found the answer. Instead of using 'Contains John Smith' or 'Contains Words John Smith', you should use 'Start with John Smith'. That will work fine with these three people. Unfortunately however, what we didn't think of was the possibility of a fourth person, called 'John Smithson'. That will break this solution again, because John Smithson starts with John Smith... Sure, this may be a rare example, but it's a possibility nevertheless and it seemed that once again there is no answer.

I believe I finally cracked it and found the ultimate solution. And it's even quite simple! Create a smart collection with two criteria that both must be met:
- Contains Words 'John Smith'
- Start With 'John Smith'

What do you think? Did I finally crack it, or did I still miss something?...
 

Jimmsp

Active Member
Joined
Jan 9, 2011
Messages
976
Location
Green Valley, Arizona, USA
Lightroom Experience
Advanced
Lightroom Version
Classic 7
At first glance, it appears that it should work.
 
Joined
Nov 16, 2015
Messages
1,686
Location
California, USA
Lightroom Experience
Intermediate
Lightroom Version
Classic 8
At first glance, it appears that it should work.
Would it not be easier to use an underscore to join two keywords, e.g. John_Smith?

Phil
 
Joined
Jul 2, 2015
Messages
8,707
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
Classic 7
Sure, and you can do that also with a (non-exporting) synonym, so you can search on the synonym and still keep the (exporting) keyword phrase with the space. But the challenge was not to do that and try to find a way to search for 'John Smith' without getting these false positives.
 
Joined
Jul 6, 2012
Messages
112
Lightroom Experience
Intermediate
Lightroom Version
Classic 8
I don't use Smart Collections, so I may not have it right, but what if the keyword list doesn't Start With "John Smith"? Or does "Start With" mean "any of the keywords starts with"?
 
Joined
Jul 2, 2015
Messages
8,707
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
Classic 7
I don't use Smart Collections, so I may not have it right, but what if the keyword list doesn't Start With "John Smith"? Or does "Start With" mean "any of the keywords starts with"?
Any of the keywords assigned to that image. Start with means that one of the the keywords must start with those characters for the image to be found. So if you have an image with the keyword ‘Jane Smith’, then “Contains Smith” will find that image, but “Starts with Smith” will not.
 
Joined
Jun 20, 2009
Messages
14,375
Location
Houston, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 8
This whole problem would be moot if Adobe would simply allow us to search with embedded spaces. Even Google allows this.

-end of rant....
The problem once introduced is not easily overcome. Adobe converts the criteria list into a standard SQL statement using SQL reserved words such as SELECT, FROM, OR, and AND. Some where in the Adobe logic at the time the space between Keywords was decided to be interpreted as the SQL language reserved word AND. In the SQL Language SELECT phrases (keyword phrases) are enclosed in quotes. So that "John Smith" is a complete phrase including the space. Adobe could recite the conversion of Criteria logic such that the 'Contains' field is enclosed in quotes to that enclosing quotes are honored in the field such that "John Smith" is considered one phrase and John Smith is interpreted as two phrases. However, doing this will break any existing Smart Collection that depends on the space to be interpreted as the SQL AND.
 
Top