FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » proximity searches using Fox trot query
proximity searches using Fox trot query [message #629] Thu, 26 October 2017 02:03 Go to next message
don.spady
Messages: 4
Registered: October 2017
Junior Member
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.
In this instance 'A' is "risk assessment" and 'B' is "method"
I tried various combinations of commands but without any real success.
e.g.
"{30} "risk assessment" methods"
and I get a lot of separated words; i.e. risk "alone" assessment
"alone" plus risk assessment "together"
"{30} ({2} risk assessment) methods"
and I get much the same result, except that even the 2 gets highlighted as
a finding.

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

I have tried various combinations but with no success.

Many thanks.

Don
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 next message
FoxTrot Engineering
Messages: 384
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
Re: proximity searches using Fox trot query [message #633 is a reply to message #629] Mon, 30 October 2017 20:00 Go to previous message
don.spady
Messages: 4
Registered: October 2017
Junior Member
This helps a great deal.
Many thanks.
Don


On Wednesday, October 25, 2017 at 6:03:29 PM UTC-6, don....@gmail.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.
> In this instance 'A' is "risk assessment" and 'B' is "method"
> I tried various combinations of commands but without any real success.
> e.g.
> "{30} "risk assessment" methods"
> and I get a lot of separated words; i.e. risk "alone" assessment
> "alone" plus risk assessment "together"
> "{30} ({2} risk assessment) methods"
> and I get much the same result, except that even the 2 gets highlighted as
> a finding.
>
> 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
>
> I have tried various combinations but with no success.
>
> Many thanks.
>
> Don
>
Previous Topic: Foxtrot 6.0 search delay
Next Topic: FoxTrot Search 6.0.2b1 for testing / High Sierra & APFS
Goto Forum:
  


Current Time: Fri Mar 29 15:15:53 GMT+1 2024