FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » proximity searches using Fox trot query
Re: proximity searches using Fox trot query [message #631 is a reply to message #629] Sat, 28 October 2017 10:23 Go to previous messageGo to previous message
FoxTrot Engineering
Messages: 406
Registered: April 2020
Senior Member
don«|dot|»spady«~at~»gmail«|dot|»com wrote:

> I want to find A near B where A may contain more than 1 word
> e.g. I want to find the words "risk assessment" within 30 words of method.

The easiest way to achieve this is to use the "includes neighboring words" criteria, and quote the consecutive words:
[includes neighboring words] ["risk assessment" method] [around one line]

If you prefer using the FoxTrot query syntax (which allows to specify more precisely the maximum distance):
[matches the FoxTrot query] [{30} "risk assessment" "method"]

With this FoxTrot query syntax, there are two variants for proximity searches:

- when a quoted string begins with a number between braces ( e.g. [matches the FoxTrot query] [x "{10} a b c d" y] ), then the found document must contain at least one occurrence of the first word in the quoted string (a) at the specified maximum distance (10 words) to occurrences of the other words in the quoted string (b, c and d); in addition to the other words outside of the quoted string (x and y) which may be found anywhere in the document.

- when a quoted string is preceded by a number between braces ( e.g. [matches the FoxTrot query] [x {10} "a" "b c" "d" y], then the found document must contain at least one occurrence of the first quoted string (either a single word, or multiple contiguous words) ("a") at the specified maximum distance (10 words) to occurrences of the other immediately following quoted strings ("b c" and "d"); in addition to the other words before the brace, and after the last quoted string (x and y) which may be found anywhere in the document.

> Is there a way to nest a query such that you have a close proximity of
> words that is then joined to one (or more) more distant words

No. However, yo can do something like this:
[matches the FoxTrot query] ["{2} risk assessment" "{30} risk method"]
to find documents that have an occurrence of [risk] very near to [assessment], and an occurrence (but not necessarily the same one) of [risk] relatively near to [method].


Jérôme - CTM Engineering


------------------------------------------------------------ ---------
"Foxtrot is amazingly fast, and the built-in highlighting is a
fantastic idea."
Constantin von Wentzel, Arlington MA

Download a demo version from www.foxtrot.ch
------------------------------------------------------------ ---------


Jérôme - FoxTrot Engineering
 
Read Message
Read Message
Read Message
Previous Topic: Foxtrot 6.0 search delay
Next Topic: FoxTrot Search 6.0.2b1 for testing / High Sierra & APFS
Goto Forum:
  


Current Time: Thu Nov 28 00:04:51 GMT+1 2024