Why LR allows keyphrases, but won't search for an entire keyphrase as one?

Status
Not open for further replies.

NJHeart2Heart

Active Member
Joined
Jun 25, 2009
Messages
463
Location
Northern NJ, USA
Lightroom Experience
Intermediate
Lightroom Version
Classic
I just recently became aware of the fact that whether your keywords are one or more than one word each, the search function (whether a straight search or criteria used for smart collections) will treat all keywords/phrases based on individual words. :'(

In other words, If I have created a keyphrase "German Shepherd", LR will not search for "German Shepherd", but rather "german" and "shepherd" (notice too that LR is NOT case sensitive). This means that if I have "German Shepherd" and also a keyword, "shepherd", if it works at all, will not discriminate between the portion of "German Shepherd" and "shepherd", but will bring back ALL photos that include "shepherd" in them, unless you specify German and shepherd must BOTH be noted on a photo.

I say "works at all" because I am still learning whether LR allows you to create what looks like a keyphrase, and also allows you to create a one word keyword separately that happens to be a part of that keyphrase. I was just working through this today on my lunch hour, and didn't get to the bottom of the mystery yet.

If this is the case, then why does LR bother to allow a person to create multi-word keyphrases? Take an example of the Flickr photos site- it allows you to create multiple word keyphrases by using quotes around the words, and then allows you to also create single word keywords...

Gurus?
 
Why isn't {Keyword}{contains all}(German Shepherd} working for you? It does for me.

I keyworded two images. One with "German Shepherd" and the Other with "Shepherd" The above SC returns the first but not the second.
{Keyword}{contains}(German Shepherd} returns both images and {Keyword}{contains words}(German Shepherd} works like {Keyword}{contains all}(German Shepherd} (at least in this case).
 
I can relate to your frustration. I stopped using key phrases long ago because it wasn't working for me (I use mixed case and mash them together, others who've encountered the same difficulty use underscores to distinguish "word" boundaries, ...) - can't be sure whether I just never learned the proper application of "contains" vs. "contains all" vs. "contains words" or whether they really aren't quite adequate. - Sure seems like allowing quotes would help.

Toss in the ability to create logical groupings like: (this1 and that1) or (this2 and that2)... and we'd really be having things.
 
Thanks Cletus. I'll give that a try. As I mentioned I was only just messing with it today a little, so I havn't really tested the boundaries.

Dawn D. in NJ
 
NJHeart2Heart - I'd love to hear about your findings. If my memory serves me correctly - there are some limitations.

I mean if you've strung a bunch of words together in a search box, some of which are to be treated as phrases, and some of which are to be treated as individual words, Lightroom can not possibly know which to treat how without quotes or something, regardless of whether you use "Contains", "Contains All", or "Contains Words", right?
 
LR is stupid when it comes to keyphrases and searches, you are correct.

That's why I've started using underscore "_" instead of space to separate individual words

German_Shepherd
shepherd
german_sausage

Searching for "german" gives two hits, searching for "German_Shepherd" gives one hit.

Perfect solution? No, but since LR search works the way it does it is at least a solution.
 
[quote author=erro link=topic=9582.msg648'3#msg648'3 date=1271524'29]
LR is stupid when it comes to keyphrases and searches, you are correct.

That's why I've started using underscore "_" instead of space to separate individual words

German_Shepherd
shepherd
german_sausage

Searching for "german" gives two hits, searching for "German_Shepherd" gives one hit.

Perfect solution? No, but since LR search works the way it does it is at least a solution.
[/quote]Have you tried changing the Smart Collection search criteria to {Contains All}?
 
You have to look at this in a larger perspective.

Lets say you have keywords for peoples names:
- John Smith
- James Smith
- John James Smith

Now you want to find all photos where John Smith appears. But not John James Smith.

Underscores makes these phrases one "word" each that you can search for exclusively: John_Smith
 
[quote author=erro link=topic=9582.msg64829#msg64829 date=127158'928]..Now you want to find all photos where John Smith appears. But not John James Smith...[/quote]You have requested a search that has two conditions
{Keywords}{ContainsAll}{John Smith}
{Keywords}{Does not contain}{James}

This is why the SC Search criteria dialog has and option for multiple rules. What you are constructing in the background is nothing more than a SQL query

SELECT {images} FROM {table}
WHERE {keyword} LIKE "John Smith"
AND {keyword} NOT LIKE "James"

By selecting the Match {all} you put an AND between the WHERE clauses. Match {any} puts an OR between them.

The problem faced by the LR developers is that the typical LR user does not know the SQL language, so the LR developers needed a way to permit a typical user to build the WHERE clause phrases without being a programmer.

I'll admit I have an advantage in that I do know SQL and I have written programs to permit typical users to construct queries like this "on the fly" without them needing to learn SQL first.

Just as you can see the underscore as an unnatural join of a first and last name, then recognise that the developers of LR permit the use of Keyword phrases because the logic is there to use them properly in a search criteria.
Any time you find yourself having to resort to artificial constructs to achieve your goals, it is probably because of your lack of understanding of how the process works, rather than a limitation of the program.

That said, as powerful as they are, there is only so much that can be done with a SQL query "SELECT...FROM...WHERE" clause. And I will admit that it took me a while (and John Beardsworth's Workflow SC Templates) to figure out how to do SubSelects and UNIONS.
 
Cletus,

I don't quite agree with your statements:

If you'd issue a statement
WHERE {keyword} LIKE "%John Smith%"
you'll get rows containing

  • [li]"John Smith"[/li]
    [li]"John Smith James"[/li]
    [li]"James John Smith"[/li]
but not

  • [li]"John James Smith"[/li]
With your clause (containing the NOT LIKE "James"), you would not get the rows containing "James John Smith" and "John Smith James", although it contains the string "John Smith".

Also, your clause
AND {keyword} NOT LIKE "James"
assumes that you know what other words could appear in the same keyword set, but usually we don't know, but we know we want the exact string "John Smith" to be present.

I also think that keyword phrases can only be used properly if LR provides some way of putting the search string in quotes, everything else will not work properly.

Beat
 
[quote author=b_gossweiler link=topic=9582.msg64845#msg64845 date=12716'6617]
Cletus,

I don't quite agree with your statements:...
I also think that keyword phrases can only be used properly if LR provides some way of putting the search string in quotes, everything else will not work properly.

Beat
[/quote]I agree with your statement to a point. I don't know exactly how the SC SQL statement structured that ths sent to the LR database. And it has been over two years since I was in a position that required intimate SQL knowledge (Retired!!!) So my SQL is probably 'rusty'.

The point I was trying to illustrate is that it is entirely possible to develop workable SC queries that can return images for almost any multiple condition without needing to resort to artificial constructions in the Keyword field. I was not trying to illustrate the 'Correctness' of my SQL structure against tables that I have not studied too closely.

I also agree, I could do more with SCs if I could embed strings in quotes and use SQL wildcards(%). However, since I suspect the developers build their WHERE clauses properly using both quotes and wildcards, the any added by the user cause the Query to break down grammatically.

Also, your clause
AND {keyword} NOT LIKE "James"
assumes that you know what other words could appear in the same keyword set, but usually we don't know
Since I don't, I almost always construct my SCs by trial and error. Building condition rules until I have eliminated all that is not what I want. Many times these are 'One offs" never to be use again but there are others that are like John Beardsworths' SC Templates and are infinately resuable.
 
Sure you can search for "John Smith", and then exclude all other keywords, but it's not a very practical solution in the long run.

I'll still argue that serching in LR could be much more powerful, and much easier also.

Smart collection should be smart, not semi-stupid.

Still, I really like LR, but I see room for improvements.
 
To throw another nut in the bunch, I thought I heard someone mention you could create nested smart collections? Wouldn't that then broaden one's ability to find exactly what they need without resorting to those artificial keyword symbols?



Dawn
 
Yes.
 
Care to elaborate on nested smart collections? And how they would help me to not exclude all keywords except those I want?
 
Also, you can select multiple collections to have the rules of both collections applied simultaneously.

PS - In Lr2, you could simultaneously select folders and collections to have the collection rules limited to specific folders. I haven't been able to get that to work in Lr3 - I guess that capability has been lost - I hope not forever.
 
SC only permit Match "All" Or match "Any" (Union of rules with AND or the Union of rules with OR)
An Example of a nested SC would be:
You can get the results of two or more SCs by using the rule {Collection}{Contains/Starts with/Ends With/etc.}{Collection Name or part of it Goes here...}
This is particularly useful if you want to AND some rules but OR others.

An example might be to find images that included Keywords like
"John Smith" or "John Doe" or "Jane Doe" AND "German" AND Not "Shepherd"
 
I think I remember reading somewhere that using a collections name as a search parameter only works for standard collections, not smart collections. Don't know if it's true or not though. Maybe someone can shed light on the subject?
 
[quote author=clee'1l link=topic=9582.msg64928#msg64928 date=127171'598]
SC only permit Match "All" Or match "Any" (Union of rules with AND or the Union of rules with OR)
[/quote]
Yes, that's standard boolean AND and OR operations. AND matches all, OR matches any. These can also be combined. So?

[quote author=clee'1l link=topic=9582.msg64928#msg64928 date=127171'598]
An Example of a nested SC would be:
You can get the results of two or more SCs by using the rule {Collection}{Contains/Starts with/Ends With/etc.}{Collection Name or part of it Goes here...}
This is particularly useful if you want to AND some rules but OR others.

An example might be to find images that included Keywords like
"John Smith" or "John Doe" or "Jane Doe" AND "German" AND Not "Shepherd"
[/quote]

Well, that still requires me to exclude all keywords that might interfere with "german". So I don't see the benefit?
 
[quote author=erro link=topic=9582.msg64932#msg64932 date=1271711178]Yes, that's standard boolean AND and OR operations. AND matches all, OR matches any. These can also be combined. So?
Well, that still requires me to exclude all keywords that might interfere with "german". So I don't see the benefit?
[/quote]The benefit is you get any images with the Keyword ""John Smith" AND "German"
Along With "John Doe" AND "German" along With "Jane Doe" AND "German" And if you don't want Germans that are Shepherds you need to exclude them "Shepherd" does not interfere with "German" and "German" is not "German Shepherd"

To avoid confusing you with words try thinking about this:
To find images that included Keywords like
"A" or "B" or "C" AND "1" AND Not "2"

Returned images might be listed with the following keywords:
A,1
B,1,
C,1
Not included would be
A
B
C
D,1
1
A,1,2
B,1,2
C,1,2
 
[quote author=areohbee link=topic=9582.msg64923#msg64923 date=12717'8615]
PS - In Lr2, you could simultaneously select folders and collections to have the collection rules limited to specific folders. I haven't been able to get that to work in Lr3 - I guess that capability has been lost - I hope not forever.
[/quote]
Can you say exactly what you mean here, Rob? I thought I understood, but found that I could create a SC "folder name / contains / desktop".

John
 
[quote author=johnbeardy link=topic=9582.msg64951#msg64951 date=1271741463]
Can you say exactly what you mean here, Rob? I thought I understood, but found that I could create a SC "folder name / contains / desktop".[/quote] Sure John -

Lets suppose I have two smart collections:
1. Photos Colored Red.
2. Photos with Ratings.

And lets suppose I have only two folders:
1. 2''9
2. 2'1'

If I want to see photos that are colored red and photos with ratings (logical OR), I can click on SC#1, then ctrl-click(windows) on SC#2. Doing this much would show me the aforementioned photos in the entire catalog, i.e. 2''9+2'1' - both smart collections selected, no folders selected.

In Lightroom 2, I can then ctrl-click(windows) on one of the folders, say 2''9, which would then exclude the aforementioned photos from 2'1' - the collections remain selected, and the 2''9 folder is also selected.

However, in Lightroom 3 beta 2, if I ctrl-click the 2''9 folder, the collections become deselected, leaving just the 2''9 folder selected. Thus I would just see all the photos in 2''9 regardless of color or rating...

Seems to be a step backward - hope not,
Rob
 
[quote author=erro link=topic=9582.msg64932#msg64932 date=1271711178]
[quote author=clee'1l link=topic=9582.msg64928#msg64928 date=127171'598]
SC only permit Match "All" Or match "Any" (Union of rules with AND or the Union of rules with OR)
[/quote]
Yes, that's standard boolean AND and OR operations. AND matches all, OR matches any. These can also be combined. So?

[quote author=clee'1l link=topic=9582.msg64928#msg64928 date=127171'598]
An Example of a nested SC would be:
You can get the results of two or more SCs by using the rule {Collection}{Contains/Starts with/Ends With/etc.}{Collection Name or part of it Goes here...}
This is particularly useful if you want to AND some rules but OR others.

An example might be to find images that included Keywords like
"John Smith" or "John Doe" or "Jane Doe" AND "German" AND Not "Shepherd"
[/quote]

Well, that still requires me to exclude all keywords that might interfere with "german". So I don't see the benefit?
[/quote]

Robert
Agree entirely - taking the John Smith and John James Smith example, you have to know that you need to exclude James OR look at the results of John Smith and then tamper with the SC to get what you want.

Interestingly I would have thought that 'starts with John smith' would have excluded James but it doesn't
 
Yes, Rob, I just haven't got round to testing it yet. Thanks.

John
 
Status
Not open for further replies.
Back
Top