FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » Foxtrot query will not run with negation conditions, even if other conditions are applied
Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1460] Sat, 18 June 2022 09:09 Go to next message
Atlas
Messages: 140
Registered: August 2009
Senior Member
I totally understand why a query with only negations like this would not run in Foxtrot query [-"regular expression" -regex], because it would probably produce too many results. However, this Foxtrot query still wouldn't run even when I apply additional conditions like "File name" must contain a string.

I have to run this type of query sometimes because I know the folder I want to narrow down to, so I do that using "File name" condition. And once I'm in the folder, I know the kind of files I don't want to see, so I want to get rid of them using Foxtrot Query. Unfortunately ... it doesn't look like I can do that in Foxtrot Search? How could it be done?

Thanks!
Re: Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1463 is a reply to message #1460] Sat, 18 June 2022 14:46 Go to previous messageGo to next message
FoxTrot Engineering
Messages: 404
Registered: April 2020
Senior Member
This should work:
[file name] [contains all of the words] [foo]
[then apply advanced filter] [contents] [does not contain the regular expression] [] [regular expression]
[then apply advanced filter] [contents] [does not contain the regular expression] [] [regex]


Jérôme - FoxTrot Engineering
Re: Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1466 is a reply to message #1463] Mon, 20 June 2022 01:22 Go to previous messageGo to next message
Atlas
Messages: 140
Registered: August 2009
Senior Member
I just tried this method, and realized that I made a mistake in describing the original problem. I get to the folder that I want by using the "path filter", and not "file name" filter, which is an advanced filter. Therefore, when I use the method described above, I would be using an advanced filter to get to the path, and then another two advanced filter to get rid of the words I don't want. Foxtrot has the condition that there must be at least one non-advanced filter and it has to be applied first. Since all of my conditions are advanced filter, it won't run.
Re: Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1467 is a reply to message #1466] Mon, 20 June 2022 08:39 Go to previous messageGo to next message
FoxTrot Engineering
Messages: 404
Registered: April 2020
Senior Member
[all items of type] [any file or folder]
[then apply advanced filter] [full path] [contains the string] [] [foo]
[then apply advanced filter] [contents] [does not contain the regular expression] [] [regular expression]
[then apply advanced filter] [contents] [does not contain the regular expression] [] [regex]

Of course this will be slow, as the filters will be executed on each file; when possible you should reduce the scope as much as possible with other criteria before applying some filters.


Jérôme - FoxTrot Engineering
Re: Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1468 is a reply to message #1467] Tue, 21 June 2022 02:22 Go to previous messageGo to next message
Atlas
Messages: 140
Registered: August 2009
Senior Member
Thanks. This looks like it should work. I didn't know that we can put [all items of type] [any file or folder] at the top. What's the effect of putting this condition on top versus bottom? In general, what's the order that Foxtrot will process conditions and how do they affect each other? I haven't seen this in documentation, and it will help me troubleshoot issues on my own going forward. Thanks for helping.
Re: Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1469 is a reply to message #1468] Tue, 21 June 2022 14:54 Go to previous messageGo to next message
FoxTrot Engineering
Messages: 404
Registered: April 2020
Senior Member
The order of the search criteria should not matter (if it does, this should probably be regarded as a bug). However, filters ([then filter by date], [then apply advanced filter] and [then filter by spotlight attribute]) are always evaluated after the other criteria (even when you add some additional criteria below the filters).

As filters can be slow, you should always try to reduce the scope first with appropriate criteria. And if you have multiple filters, it should be faster to place the filter that reduces the scope the most before the other ones.

One of the purposes of [all items of type] is to let using filters when you have no other criterion, while pushing users to use a more restricting criterion.


Jérôme - FoxTrot Engineering
Re: Foxtrot query will not run with negation conditions, even if other conditions are applied [message #1471 is a reply to message #1469] Wed, 22 June 2022 10:13 Go to previous message
Atlas
Messages: 140
Registered: August 2009
Senior Member
Thanks. What you wrote NEEDS to be in whatever user guide that exists for Foxtrot. Even though I've been using Foxtrot for years, I've not been able to understand the rules as clearly as you've stated.
Previous Topic: REQUEST: Add "Contain all of the strings"
Next Topic: Any way to index and search for alias?
Goto Forum:
  


Current Time: Thu Oct 10 16:31:39 GMT+2 2024