[NR] Formula Category - Order of filters giving different results

Started by Darius1968, June 18, 2023, 07:14:38 AM

Previous topic - Next topic

Darius1968

I set up this formula category:
DOES NOT WORK: 
"@Folder[file://C:/___BU/2021/00/Family/Darius/Interests/Clothes/__Shoe Consideration/]" OR "@Attribute[Clothes.Notes,contains-all,Darius;Kooros's;Shoe;Consideration]"


Then,
WORKS: 
"@Attribute[Clothes.Notes,contains-all,Darius;Kooros's;Shoe;Consideration]"OR "@Folder[file://C:/___BU/2021/00/Family/Darius/Interests/Clothes/__Shoe Consideration]"


The conclusion here is that I was able to solve my problem and get the result I expected, simply by reversing the order of the filters, but not actually changing any parameters.  So, I'm presenting the scenario here for evaluation as a possible bug. 



Mario

The Boolean OR operation is commutative  so the order should not matter.
IMatch calculates the left side of the OR, then the right side, and then merges the two results to apply the OR.

I cannot reproduce this and there are no other related reports.

Under which conditions does this happen?
How many files do the two expressions return?

A OR B

If you create one category for the A formula and another category for the B formula, do they contain the files you think they should contain?

What if you create category C which combines the A and B category using OR?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

axel.hennig

I tried to reproduce this, but was not able.

I did create a folder (subA) containing 4 images and applied "test1" and "test2" (Attribute Set "Clothes.Notes") to 4 images. One image has "test1" and "test2" and is in the "subA" folder. The other 3 images with "test1" and "test2" are in other folders.

Then I've created 4 categories (formula-based) as follows:

A = "@Folder[file://D:/z_tmp/IMatch TEST/pics/subA/]"
B = "@Attribute[Clothes.Notes,contains-all,test1;test2]"
C1 (AorB) = "@Folder[file://D:/z_tmp/IMatch TEST/pics/subA/]" OR "@Attribute[Clothes.Notes,contains-all,test1;test2]"
C2 (BorA) = "@Attribute[Clothes.Notes,contains-all,test1;test2]" OR "@Folder[file://D:/z_tmp/IMatch TEST/pics/subA/]"
D1 (AandB) = "@Folder[file://D:/z_tmp/IMatch TEST/pics/subA/]" AND "@Attribute[Clothes.Notes,contains-all,test1;test2]"
D2 (BandA) = "@Attribute[Clothes.Notes,contains-all,test1;test2]" AND "@Folder[file://D:/z_tmp/IMatch TEST/pics/subA/]"

The result is shown in the following screenshot (as fare as I can see everything is correct):
sc1.jpg

Mario

Any further info on this?
Axel cannot repro it, I cannot repro it, no other user has ever reported a similar problem.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

I'm able to get around the problem by following your suggestion (and Axel's example) of first creating two categories - A and B.  Then, I can combine those two categories (using AND or OR), and regardless of the order, I'm getting the expected result.  

The original problem still remains, however: 
That of combining the two  arguments (one for the folder, and the other for the attribute) into just one category, from the start, without having two first, set up two separate categories (one for each argument), and then, combine them into another category, as Axel has done.  Otherwise, as I showed in my first posting to this topic, the attribute argument must come first, or else, I get the unexpected result, which is what I'm trying to figure out and solve. 

axel.hennig

Quote from: Darius1968 on June 21, 2023, 03:54:06 PM...set up two separate categories (one for each argument), and then, combine them into another category, as Axel has done.

That's not true. If you look into my post, the formula is not A OR B or B OR A, the formula I've used (and cannot reproduce your problem) is Folder OR Attrbute or Attribute OR Folder (both working).

Mario

I can also not reproduce the OP's results. It makes no matter which comes first, the result is always the same. And has to be, because IMatch evaluates both sides of the OR and then performs the OR.
The only thing I could think of would be some weird bit pattern or something, but that's really unlikely.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

thrinn

Quote from: Darius1968 on June 21, 2023, 03:54:06 PMThe original problem still remains, however: 
@Darius1968: The "DOES NOT WORK" and "WORKS" definitions of the @Folder part are not exactly identical: In the "DOES NOT WORK" sample, there is an additional slash before the closing bracket (/]) which is missing in the "WORKS" sample.
Is this only a typo in the post?
Thorsten
Win 10 / 64, IMatch 2018, IMA

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

Quote from: thrinn on June 21, 2023, 04:57:36 PM
Quote from: Darius1968 on June 21, 2023, 03:54:06 PM@Darius1968: The "DOES NOT WORK" and "WORKS" definitions of the @Folder part are not exactly identical: In the "DOES NOT WORK" sample, there is an additional slash before the closing bracket (/]) which is missing in the "WORKS" sample.
Is this only a typo in the post?
That's a good observation, but it's not the reason I'm having trouble.  It is probably a typo in this post.  If I remove the forward slash, it will be reinstated by IMatch when I close the dialog.  So, that's not the reason. 

Mario

Since nor I nor thrinn could reproduce this and no other user ever reporting a similar issue, I'll close this ticket until you are able to give me some steps to reproduce this.

Maybe you can create a small database with some images and a category formula that produces this invalid result?
In that case, fell free to add more info to this ticket.

I'll close this ticket for now.
I have spent a sufficient amount of time on something which appears to be reproducible only on one computer and with one specific database. I will reopen this of course if you have more data to work with.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook