Find files with x keywords

Started by sinus, July 31, 2018, 09:08:06 AM

Previous topic - Next topic

sinus

I have in the Windows Layout this variable:

{File.MD.XMP::dc\subject\Subject\0|count:true;between:6,20,G1;pereplace:0==;pereplace:G1==<Image Source='file://c:\sinus-icons\key20-24.png'/>}

It shows me the number of assigned keywords and displays it with an icon, works perfect.

Now how could I find all files in the whole DB with keywords between 0 (no keys) and 3?

I tried something with filtering, but since I'm at war with filtering (the only part of IMatch, what goes over my head), I had no success.
Also with DatatDriven categories I had no luck.

I tried e.g. something with this variable

{File.MD.XMP::dc\subject\Subject\0|count:true;between:0,1}

I guess, there is an easy solution for this, but I a am not able to find it.  :-[

Best wishes from Switzerland! :-)
Markus

Mario

#1
Users sometimes need the most curious things...
Usually users only want to know which files have no keywords at all, and for this you can use the standard No Keywords category under IMatch Workflow Categories.

To create a data-driven category which counts the number of keywords per file, just use a variable-based data-driven category and this variable:

{File.MD.XMP::dc\subject\Subject\0|count:true}

Set the data type to integer.

This gives you child categories from 0 to n, where n is the maximum number of keywords used.

Note: Make sure this category is set to manual because it will be slow.
Only update it when needed. Counting the number of keywords assigned to each file is a very time-consuming operation.

On my PC, updating this category for a 500,000 files database takes about 40 seconds. Which is really quite fast for this complex task: Interpreting the variable 500,000 times, retrieving the keywords for 500,000 files and counting them, then producing the category. Definitely something you want to do only when really needed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on July 31, 2018, 09:32:31 AM
Users sometimes need the most curious things...

True, true ... and sometimes programmers program the strangest things.  ;D ... sorry, could not resist.  8)

I must have this, because I want know, are there image with "only" 3 keywords or over 100 and so on.


Thanks a lot, Mario, I will just try this out!, I am quite sure, it will work.
Best wishes from Switzerland! :-)
Markus

Mario

Be glad that you have IMatch. Not many DAM software out there would even allow you to do such things.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on July 31, 2018, 09:48:57 AM
Be glad that you have IMatch. Not many DAM software out there would even allow you to do such things.

I am happy, since 2001.  :D
Best wishes from Switzerland! :-)
Markus

sinus

Quote from: Mario on July 31, 2018, 09:32:31 AM

{File.MD.XMP::dc\subject\Subject\0|count:true}

On my PC, updating this category for a 500,000 files database takes about 40 seconds. Which is really quite fast for this complex task: Interpreting the variable 500,000 times, retrieving the keywords for 500,000 files and counting them, then producing the category. Definitely something you want to do only when really needed.

Works perfectly.  :D Thanks!

On my PC with my 257.000 - files-DB it takes about 80 seconds. But I have a bit slow harddisks.
But this is incredible fast, and of course I put it not on automatic-refresh.
Best wishes from Switzerland! :-)
Markus

Mario

That's really slow. 4 times slower than on my 3 year old computer. But I use SSD storage, which is a massive speed improvement for everything.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook