FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » BUG: Cannot combine Foxtrot Query's exclusion syntax across multiple search fields
BUG: Cannot combine Foxtrot Query's exclusion syntax across multiple search fields [message #1493] Wed, 27 July 2022 11:37 Go to next message
Atlas
Messages: 140
Registered: August 2009
Senior Member
Currently, we can combine the exclusion syntax with other Foxtrot Query syntax in the SAME FIELD. But it doesn't look like I can combine a search field that contains only Foxtrot Query exclusion with another search field.

1. Query 1: This works as expected, when I'm using one search field with the Foxtrot Query "find all documents with the word inflation and not mmo"
2. Query 2: No results. This should give the same results as the Query 1, because I'm just splitting the condition into two fields. The first field says "find all documents with the word inflation", and the second field says "not the word mmo". Both fields are combined using "All criteria (AND)"

The realistic workflow where I experience this problem is this: Find all documents with the word "inflation" anywhere, and not the word "mmo" in its file name. Foxtrot query doesn't allow me to search by properties like file name, so I have to break my Foxtrot query into multiple fields. Please let me know if this is a bug, or if this is a limitation with Foxtrot Query exclusion syntax that's not described in documentation.
Re: BUG: Cannot combine Foxtrot Query's exclusion syntax across multiple search fields [message #1495 is a reply to message #1493] Wed, 27 July 2022 12:14 Go to previous messageGo to next message
FoxTrot Engineering
Messages: 406
Registered: April 2020
Senior Member
This is a limitation. The workaround is to use filters:
[contents, any metadata or filename] [includes all of the words] [inflation]
[then apply advanced filter] [file name] [does not contain the string] [ignore case] [mmo]

If you want exclude filenames that do not contain the word mmo, but not the string mmo as part of a longer word, use a regular expression:
[contents, any metadata or filename] [includes all of the words] [inflation]
[then apply advanced filter] [file name] [does not contain the regular expression] [case incensitive | \w, \d, \s, \b also apply to Unicode characters] [\bmmo\b]


Jérôme - FoxTrot Engineering
Re: BUG: Cannot combine Foxtrot Query's exclusion syntax across multiple search fields [message #1496 is a reply to message #1495] Wed, 27 July 2022 12:27 Go to previous messageGo to next message
Atlas
Messages: 140
Registered: August 2009
Senior Member
Thanks. Can you please help me understand these two followup questions:

(1) What exactly is the limitation that you're expressing? I just checked and it looks like I can combine multiple search fields that use Foxtrot query, so can you please describe the current limitation? I need to know what I should avoid

(2) The recommendations you gave will work when each individual search condition on the file contents and on the file names are simple. However, they don't work if I have a complex set of conditions on the file contents and on the file names. For example, "find all documents with the word inflation and mmo within 5 words of each other in the content, but not files that have msnbc and cnn within 5 words of each other in the name". I'm just made up a simple query in the original post to illustrate the problem, but my actual Foxtrot Queries are a lot more complex (it's the reason why I have to use the Foxtrot Queries in the first place). Is there still a way to workaround the limitation?

[Updated on: Wed, 27 July 2022 12:30]

Report message to a moderator

Re: BUG: Cannot combine Foxtrot Query's exclusion syntax across multiple search fields [message #1498 is a reply to message #1496] Wed, 27 July 2022 16:01 Go to previous message
FoxTrot Engineering
Messages: 406
Registered: April 2020
Senior Member
1) In essence, a FoxTrot query consists of locating in the index the documents that contain one or multiple full words. There are a few refinements which allow finding partial words (a*, *a, *a*), finding one of several words (a | b | c), searching in specific metadata or content fields only, ignoring found documents where searched words are not found consecutively ("a b") or in a given proximity range, ignoring found documents containing some other words (a -b), ignoring found documents where the found words use different casing, etc. You can also use a boolean AND / OR (all criteria / any criterion) with multiple queries.

But there is no way to just locate in the index the documents that do not contain some words. And you can't use complex boolean operations like: (a OR b) AND (c OR d) nor: a AND NOT b.

2) No, we do not have this level of flexibility. But maybe you can manage to create a regular expression that fulfills your needs, e.g.
msnbc( \w+){0,4} ?cnn|cnn( \w+){0,4} ?msnbc


Jérôme - FoxTrot Engineering
Previous Topic: BUG: Not seeing keyword highlights
Next Topic: Is Foxtrot Query heading toward deprecation?
Goto Forum:
  


Current Time: Sun Nov 24 03:24:48 GMT+1 2024