• 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.
  • The August 2019 Lightroom updates are now available. Lightroom Classic includes advanced GPU support, batch HDR/pano merge and more. Lightroom (cloud-based service) has deleted photos on the desktop/mobile apps, as well as video support and batch metadata editing on Android. The Missing FAQ and Edit Like a Pro eBooks are already updated for the changes.
  • 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.

Smart Gallery Query parameters

thalesm

New Member
Joined
Nov 2, 2015
Messages
10
Lightroom Experience
Advanced
Lightroom Version
Lightroom Version
8.3.1
Operating System
Windows 10
Hi everyone,
I'm having a problem with making the right query that I want with LR.
I tried several ways but it looks that the "OR" operator does not have a place in LR
Let's say that I want to select in my catalog some images that have "Job=Type A" or "Job=Type B".
The catalog has in the "Job field", 5 values ranging from "Type A" to "Type E".
I also tried the hidden "Alt" and click on plus symbol, but nothing makes gave the right answer.
This is what I want:
Get from the database:
All Pick Flag= flagged and
All Label Color=blue and
All Family View 12 that contains only the word "Nadia" And
Job that contains "Type A" OR Job that contains "Type B". ( don't select Job c,d,e)

Lr is very confusing in the way it handles the operators (AND, OR, NOT, =, and etc...).
They tried to make it easier for people that don't have the right knowledge of a SQL database queries for example:

12765



The definition of what they meant by contains or contains all and some other terms that they use are not very clear and I couldn't find any documentation or a good explanation of what they meant by those terms in the selection.
12766


At this point, I don't know if my query is possible in LR and would like to have some help on this and if possible if someone has a good explanation of those confusing operators that LR uses in the queries.

Thank you
 
Joined
Oct 8, 2007
Messages
5,069
Location
London
Lightroom Experience
Power User
Have you not tried pressing the Alt/Opt key when you add a parameter? This would allow you to nest the job criteria.

Yes, the smart collection is quirky and a bit confusing.
 
Joined
Jun 20, 2009
Messages
14,661
Location
Houston, TX USA
Lightroom Experience
Power User
Lightroom Version
Yes, the smart collection is quirky and a bit confusing
The Criteria construction is built for an intended audience that has no knowledge of the Structured Query Language (SQL). It is not expected that these folks would have a significant need for a complex query.
 
Joined
Oct 8, 2007
Messages
5,069
Location
London
Lightroom Experience
Power User
Sure, but it's still weird. That Alt/Opt trick should never have been hidden, for example, and how "Starts with" functions would fool most people.
 

thalesm

New Member
Joined
Nov 2, 2015
Messages
10
Lightroom Experience
Advanced
Lightroom Version
Thanks for the comments so far.
The problem is also because Adobe doesn't provide a clear and full explanation of the terms used as selectors on those queries.
What is behind "contain all" or "contains words".
Let us say that the search criteria is to be "images of London" on a database that has "images of London streets", "images of London Tower", " images of London parks" in a field to be searched.
All entries contain the words "images of London" and I just want "images of London streets" OR "images of London parks" as a result of the query.
It's confusing if they don't specify what is behind the terms contains all, contain words, contains and etc.... Each line of the rule table is an "AND" or an "OR" for the final query?
Does anyone saw an official document from Adobe on those questions? I haven't!. Even the "!" (not) is not documented also. I found that it works by accident.
Answering to johnbeardy. Yes, I tried also the Alt/Opt key, but it does not provide me the correct intended search answer.
Answering to cleeo1I. More and more photographers are using LR for several reasons. For me the two main areas are:
1- simple raw treatments otherwise I'll use Photoshop.
2- organization of images (library module). By the way, even with a small database, it hangs a lot. The only solution is to restart LR, which I must do every 15 min. or so depending on the number of metadata that I change or update. With a database of 50K images that I have, it's almost impossible to work in the library module. Adobe says that it can handle large databases (100K or more) but this is not true if you expect to have a resonable response time over those updates of information. They must re-think/optimize the database/library module. This is a big issue in my opinion.
Thank everyone for the help so far, and let's hope for some more details on how to handle those reported problems.
Cheers
 
Joined
May 9, 2015
Messages
349
Lightroom Experience
Power User
Does anyone saw an official document from Adobe on those questions? I haven't!
In item 4 of How to find photos in a catalog in Lightroom Classic they define these terms as used in text filters

Contains
Searches for the specified alphanumeric sequence(s), including partial words. For example, performing a Contains search for flo returns results that include the word flower. If multiple sequences are entered, Lightroom Classic finds photos that contain any of the individual sequences.

Contains All
Searches for text that contains all specified alphanumeric sequences. Say, for example, you have a folder of photos of a family gathering, and each photo is tagged with the names of the individuals in the shot. You could perform a Contains All search on Joh and Su to find all photos that contain both John and Susan. Simply enter a space between search terms.

Contains Words

Searches for text that contains all specified alphanumeric sequences as whole words. To find photos with the keyword flower using a Contains Word search, for example, type flower.

Doesn’t Contain
Searches for text that does not contain any specified sequence.

Starts With
Searches for text that begins with the specified alphanumeric sequence.

Ends With
Searches for text that ends with the specified alphanumeric sequence.


Even the "!" (not) is not documented
In item 5 of the same document you will find

Note:
Add an exclamation point (!) before any word to exclude it from the results. Add a plus sign (+) before any word to apply the Starts With rule to that word. Add a plus sign (+) after any word to apply the Ends With rule to that word.


In the document on collections they mention in a note for smart collections that the operators are the same as for text filters. What they don't mention is the use of the alt key (Option on Mac) to "indent" and thus allow an infinite mix of and and or operations

Here, for example, is one of my smart collections....

12773



As you can see, they can be quite sophisticated.
 

thalesm

New Member
Joined
Nov 2, 2015
Messages
10
Lightroom Experience
Advanced
Lightroom Version
In item 4 of How to find photos in a catalog in Lightroom Classic they define these terms as used in text filters

Contains
Searches for the specified alphanumeric sequence(s), including partial words. For example, performing a Contains search for flo returns results that include the word flower. If multiple sequences are entered, Lightroom Classic finds photos that contain any of the individual sequences.

Contains All
Searches for text that contains all specified alphanumeric sequences. Say, for example, you have a folder of photos of a family gathering, and each photo is tagged with the names of the individuals in the shot. You could perform a Contains All search on Joh and Su to find all photos that contain both John and Susan. Simply enter a space between search terms.

Contains Words
Searches for text that contains all specified alphanumeric sequences as whole words. To find photos with the keyword flower using a Contains Word search, for example, type flower.

Doesn’t Contain
Searches for text that does not contain any specified sequence.

Starts With
Searches for text that begins with the specified alphanumeric sequence.

Ends With
Searches for text that ends with the specified alphanumeric sequence.




In item 5 of the same document you will find

Note:
Add an exclamation point (!) before any word to exclude it from the results. Add a plus sign (+) before any word to apply the Starts With rule to that word. Add a plus sign (+) after any word to apply the Ends With rule to that word.


In the document on collections they mention in a note for smart collections that the operators are the same as for text filters. What they don't mention is the use of the alt key (Option on Mac) to "indent" and thus allow an infinite mix of and and or operations

Here, for example, is one of my smart collections....

View attachment 12773


As you can see, they can be quite sophisticated.
Thanks for the information.
 
Joined
Jun 24, 2010
Messages
1,565
Location
Encinitas, CA USA
Lightroom Experience
Advanced
Lightroom Version
But even given all this sophistication you still cannot search for any strings with embedded spaces. This makes it practically impossible to search for real world expressions like "San Diego" or "John Smith".

Cletus I did read your response to my last post regarding this limitation (bug IMHO) and I understand that the default treatment of a space as a OR is valid. However, computer text searches since almost the beginning have allowed many methods escaping special characters imbedded in text and to not allow for that within the Lightroom text searching/matching is a significant oversite.

-louie
 
Joined
Jun 20, 2009
Messages
14,661
Location
Houston, TX USA
Lightroom Experience
Power User
Lightroom Version
But even given all this sophistication you still cannot search for any strings with embedded spaces. This makes it practically impossible to search for real world expressions like "San Diego" or "John Smith".

Cletus I did read your response to my last post regarding this limitation (bug IMHO) and I understand that the default treatment of a space as a OR is valid. However, computer text searches since almost the beginning have allowed many methods escaping special characters imbedded in text and to not allow for that within the Lightroom text searching/matching is a significant oversite.

-louie
Yes, agreed. Adobe early on made a big mistake wrt the treatment of spaces in a query. Making it right as they should will break a lot of existing Smart Collections. It is my opinion that they should create a new query process as an option retaining the old query process as they have done with "Process Version" Old queries would default to the old query process and new query editor would default to the new query process.
 
Joined
May 9, 2015
Messages
349
Lightroom Experience
Power User
But even given all this sophistication you still cannot search for any strings with embedded spaces. This makes it practically impossible to search for real world expressions like "San Diego" or "John Smith".

Cletus I did read your response to my last post regarding this limitation (bug IMHO) and I understand that the default treatment of a space as a OR is valid. However, computer text searches since almost the beginning have allowed many methods escaping special characters imbedded in text and to not allow for that within the Lightroom text searching/matching is a significant oversite.
Yep. We've been complaining about that since version 1. Using a space as a delimiter is fine but only if you then allow spaces in Quotes (e.g. "San Diego") to be treated as a single string and not two strings).
 
Joined
Jul 2, 2015
Messages
8,955
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
True, but there is a useful workaround. Like I mentioned in another thread, you can effectively search for 'John Smith' by using 'Starts with John Smith'. If you have images that are still giving false positives because they contain 'John Smithson', then you can add 'Contains words John Smith', or you can add 'Ends with John Smith'. That will work fine in almost all situations.
 
Joined
May 9, 2015
Messages
349
Lightroom Experience
Power User
Yes, that is a work around that can yield the desired results in most cases using Smart Collections. A tad more difficult (impossible?) to do with the filter bar though.

But, any way you slice it, it is a kludge to get around a poor design choice by Adobe to not allow quoted strings (e.g. "John Smith" in filter and Smart Collection text arguments. It is not like putting search strings in quotes (or other means to the same end) is cutting edge technology. Even when LR/1 came out, this sort of thing was common in one form or another in almost every application that allowed searches for text strings. It also seems that the SQLite database (utilized by the catalog) allows the use of quoted strings as literals in search arguments ("WHERE" clause) so there really is no excuse for Adobe not allowing such syntax.
 
Joined
Jul 2, 2015
Messages
8,955
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
In the Filter bar there is a work around too, but that is even more kludgy: First, select the filter by Metadata and set one of the columns to Keywords. Then, in the top right of that column, click on the three stripes. Select 'Flat' rather than 'Hierarchical'. Now you can click on a keyword and that will select only images that have this exact keyword assigned to them, not images that have 'John' and 'Smith' in two different keywords and also not images that have a sub-keyword of 'John Smith' assigned, but not 'John Smith' itself.
 

thalesm

New Member
Joined
Nov 2, 2015
Messages
10
Lightroom Experience
Advanced
Lightroom Version
Hi everyone,
This topic just got very interesting and very useful for people relying on smart queries and searches. All the threads are able to show that the is a real problem for Adobe to solve. Maybe they didn't realize what users will be doing once they got a database to organize their images. It looks to me that their main focus is in the develop module which will handle simple tasks on image treatment. Any serious one will have to fall back to Photoshop. On the other hand, the library module which handles all other things besides Develop, Map, Book, Slideshow, Print, and Web is almost the same since the last major database upgrade that made all old database to be updated. All the queries and search are done under this module in my understanding, and there is a lot of other problems there that are not addressed by Adobe in the latest updates. Like I mentioned in one of my last posts, the only way to make the database regain responsiveness is to restart LR, which is awkward.
" By the way, even with a small database, it hangs a lot. The only solution is to restart LR, which I must do every 15 min. or so depending on the number of metadata that I change or update. With a database of 50K images that I have, it's almost impossible to work in the library module. Adobe says that it can handle large databases (100K or more) but this is not true if you expect to have a reasonable response time over those updates of information. They must re-think/optimize the database/library module. This is a big issue in my opinion."
Thank you again for every input on this thread and if anyone has other similar problem it would be nice to document it here. In this way, Adobe can be aware of the problem, and maybe move those database problems to a higher priority in the maintenance list of future updates.
Cheers
 
Joined
Jun 24, 2010
Messages
1,565
Location
Encinitas, CA USA
Lightroom Experience
Advanced
Lightroom Version
@Johan Elzenga ,

Thanks for your idea for how to work around the problem. I did read that.

It is I believe so unnecessary when all that has to be done is allow for quoted strings as a search term. Standard string searching since the early 1970's. I know LUA supports this and I am sure the SQL does also. So why it is Lightroom doesn't is a mystery to me me

It is one of the first things I had trouble with when I started using Lightroom 3. Here is my problem report eight years ago.

filter_keywords_in_the_keyword_list_panel_does_not_match_imbedded_spaces_in_keywords

Maybe if we had 500 people start to complain Adobe would listen. So tell all your friends and your friends friends....

-louie
 

thalesm

New Member
Joined
Nov 2, 2015
Messages
10
Lightroom Experience
Advanced
Lightroom Version
@Johan Elzenga ,

Thanks for your idea for how to work around the problem. I did read that.

It is I believe so unnecessary when all that has to be done is allow for quoted strings as a search term. Standard string searching since the early 1970's. I know LUA supports this and I am sure the SQL does also. So why it is Lightroom doesn't is a mystery to me me

It is one of the first things I had trouble with when I started using Lightroom 3. Here is my problem report eight years ago.

filter_keywords_in_the_keyword_list_panel_does_not_match_imbedded_spaces_in_keywords

Maybe if we had 500 people start to complain Adobe would listen. So tell all your friends and your friends friends....

-louie
Does anyone know how to make this problem get to Adobe developers?
 
Joined
Jun 20, 2009
Messages
14,661
Location
Houston, TX USA
Lightroom Experience
Power User
Lightroom Version
Does anyone know how to make this problem get to Adobe developers?
Bug Report / Feature Request found in the menu at the top of this page. The "500" complainers that Louie mentioned would need to comment or give the feature request enough hits to get Adobe's attention. This is still no guarantee that Adobe will take action.
It seems to me that Adobe has two teams of application developers. One focuses on image enhancements which can be extended to Photoshop app as well. The other (if it even exists) is responsible for Data Asset Management which handles the Library Module.
 

Roelof Moorlag

Senior Member
Joined
Jan 27, 2013
Messages
1,094
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
Joined
Jun 24, 2010
Messages
1,565
Location
Encinitas, CA USA
Lightroom Experience
Advanced
Lightroom Version
Top