Unexpected results on AND mode in search

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aubrey97
Posts: 55
Joined: 22 Jun 2013 11:27

Unexpected results on AND mode in search

Post by aubrey97 »

I am getting very unexpected results using AND in searches. Not sure whether it is my misunderstanding, or whether there is some sort of a bug involving (particularly) the way in which comment tags are handled. Normally one would expect AND to produce the union of the two independent searches, but this is not what happens. Take this example:

Search 1: Looks for all files with the tag latexdone on my X drive, using

X:\?tags:latexdone /r /t

The result is correct showing 2766 items all of which have that tag:
xypl1.png
xypl1.png (55.83 KiB) Viewed 586 times
Search 2: Looks for all files with a comment using

X:\?!cmt:"" /r /t

As far as I can figure out the only way to do this is to do an inverse search on the tag database looking for null comment as above. The result too is correct showing 3 items with a comment (none of which happen to have the Latexdone tag)
xypl2.png
xypl2.png (50.96 KiB) Viewed 586 times
Search 3: Looks for all files with both of the above using

X:\?!cmt:"" & tags:latexdone /r /t

As it happens I am using click and search but that is by the by

The result here should be no files. However the union picks up 23 files, none of which are in the union of searches 1&2, but all of which have any unrelated entry in the tag database (any comment or label) and do not have the latexdone tag.
xypl3.png
xypl3.png (57.55 KiB) Viewed 586 times
What is wrong with my syntax?

What it is picking up is all files in the tag database which do NOT have the latexdone tag. I cannot work out how that fits with the syntax, or the operation of the AND facility in the click and search.

jupe
Posts: 2758
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Unexpected results on AND mode in search

Post by jupe »

try changing this option:

Configuration | Find and Filter | Find Files & Branch View | Find Files | Enable smart Boolean query parsing

or prefixing your search with a colon, also /r is the default so it isn't required, you don't have to invert the cmt: either, e.g. this should work too (regardless of the above setting):

Code: Select all

x:\?:cmt:?* AND tags:latexdone

aubrey97
Posts: 55
Joined: 22 Jun 2013 11:27

Re: Unexpected results on AND mode in search

Post by aubrey97 »

Thanks for the help. Changing the cmt search to a method without inversion solves it, but raises questions then about use of inversions in booleans.
Smart boolean was already checked.

Why would the first method not have worked, as we had the union of two valid expressions ?

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Unexpected results on AND mode in search

Post by admin »

I cannot reproduce a failure with your syntax. Works just as well as jupe's one over here.

Only your switch was wrong, maybe that was somehow causing it (though not here):
RIGHT: /rt
WRONG: /r /t

Post Reply