Author Topic: Search for images with specific number of keywords?  (Read 3431 times)

Offline thomaskyhn

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Search for images with specific number of keywords?
« on: June 18, 2022, 10:30:34 AM »
Is it possible to search for images with a specific number of keywords (or more/fewer than a specific number of keywords)?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Search for images with specific number of keywords?
« Reply #1 on: June 18, 2022, 04:09:35 PM »
No, this is not currently possible.

-Kirk

Offline thomaskyhn

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Re: Search for images with specific number of keywords?
« Reply #2 on: June 19, 2022, 01:00:58 AM »
Thanks for the info.

Thomas

Offline Mick O (Camera Bits)

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • Camera Bits
Re: Search for images with specific number of keywords?
« Reply #3 on: June 22, 2022, 11:38:37 AM »
Oddly, I was just trying to do this myself, and I found that if I exported a spreadsheet of my keywords and filenames, I could use this clever excel formula to count the keywords:
https://exceljet.net/formula/count-total-words-in-a-cell

Make sure to scroll down to the version that accounts for empty cells for images with no keywords.  You could sort the spreadsheet by wordcount and then select the filenames from whatever range you needed and load that back into PM as a selection.  Not something you would want to do dozens of times, but if you only needed to do it once, this might help you?

Mick
Mick O
Camera Bits

Offline thomaskyhn

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Re: Search for images with specific number of keywords?
« Reply #4 on: June 22, 2022, 02:04:32 PM »
Oddly, I was just trying to do this myself, and I found that if I exported a spreadsheet of my keywords and filenames, I could use this clever excel formula to count the keywords:
https://exceljet.net/formula/count-total-words-in-a-cell

Make sure to scroll down to the version that accounts for empty cells for images with no keywords.  You could sort the spreadsheet by wordcount and then select the filenames from whatever range you needed and load that back into PM as a selection.  Not something you would want to do dozens of times, but if you only needed to do it once, this might help you?

Mick

Thanks for the suggestion. I've tried it but I can't get Excel to accept the formula, I get the "There's a problem with this formula" message, and I can't figure out what's wrong.

Thomas

Offline Odd Skjaeveland

  • Full Member
  • ***
  • Posts: 188
    • View Profile
Re: Search for images with specific number of keywords?
« Reply #5 on: June 23, 2022, 12:23:23 AM »
I get the "There's a problem with this formula" message, and I can't figure out what's wrong.

Excel formulas tend to break when copied between different locales or languages.
--
Odd S.

Offline thomaskyhn

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Re: Search for images with specific number of keywords?
« Reply #6 on: June 23, 2022, 12:53:04 AM »
I get the "There's a problem with this formula" message, and I can't figure out what's wrong.

Excel formulas tend to break when copied between different locales or languages.

Thanks. I wasn't aware of that.

I found a very basic workaround: replacing every individual keyword/string of hierarchical keywords with a single character using search and replace.

Offline Odd Skjaeveland

  • Full Member
  • ***
  • Posts: 188
    • View Profile
Re: Search for images with specific number of keywords?
« Reply #7 on: June 23, 2022, 03:58:44 AM »
I wasn't aware of that.

The formula uses/calls Excel functions like LEN(), TRIM(), SUBSTITUTE()... In case your Excel is for a non-English language, the functions may have different names. Yes, it is Microsoft wisdom :) If so, you need to amend the function names used in your formula accordingly. Functions like SUBSTITUTE() and IF() require a list of arguments separated by a list-separator-character. That is typically a comma or a semicolon depending on locale. You may have to replace the list separator.

Your spreadsheet may require the IF(LEN(TRIM(B5))>0,1,0) rather than LEN(TRIM(B5)). My LibreOffice spreadsheet returns boolean True or False rather than 1 or 0 and I need the IF() variant. On my system: IF(LEN(TRIM(B5))>0;1;0).
--
Odd S.

Offline thomaskyhn

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Re: Search for images with specific number of keywords?
« Reply #8 on: June 23, 2022, 04:05:58 AM »
I wasn't aware of that.

The formula uses/calls Excel functions like LEN(), TRIM(), SUBSTITUTE()... In case your Excel is for a non-English language, the functions may have different names. Yes, it is Microsoft wisdom :) If so, you need to amend the function names used in your formula accordingly. Functions like SUBSTITUTE() and IF() require a list of arguments separated by a list-separator-character. That is typically a comma or a semicolon depending on locale. You may have to replace the list separator.

Your spreadsheet may require the IF(LEN(TRIM(B5))>0,1,0) rather than LEN(TRIM(B5)). My LibreOffice spreadsheet returns boolean True or False rather than 1 or 0 and I need the IF() variant. On my system: IF(LEN(TRIM(B5))>0;1;0).

Thanks, I'll give that a try!

I'm not sure if it makes any difference, but I use Excel in English.

Offline Mick O (Camera Bits)

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • Camera Bits
Re: Search for images with specific number of keywords?
« Reply #9 on: June 23, 2022, 11:12:14 AM »
Thanks Odd S for chiming in.  I confess to not being that great with Excel --  While that article was written to be used in Excel, I actually used that formula in Google Sheets where it works like a charm.  Sorry I can't be more help in Excel, but I'm glad you are finding a workaround.

Mick
Mick O
Camera Bits