W/N Connector

Use the W/N connector in a search request to specify that one word or phrase must occur within N words of the other.  For example, apple w/5 pear would retrieve any document that contained apple within 5 words of pear.  The following are examples of search requests using W/N:  

(apple or pear) w/5 banana

(apple w/5 banana) w/10 pear

(apple and banana) w/10 pear

The pre/N connector is like W/N but also specifies that the first expression must occur before the second.   Example:

(apple or pear) pre/5 banana

Some types of complex expressions using the W/N connector will produce ambiguous results and should not be used.  The following are examples of ambiguous search requests:

(apple and banana) w/10 (pear and grape)

(apple w/10 banana) w/10 (pear and grape)


In general, at least one of the two expressions connected by W/N must be a single word or phrase or a group of words and phrases connected by OR.  Example:

(apple and banana) w/10 (pear or grape)

(apple and banana) w/10 orange tree

If you enter an ambiguous search request, dtSearch will display a message warning you of the error. 

dtSearch uses two built in search words to mark the beginning and end of a file: xfirstword and xlastword.  The terms are useful if you want to limit a search to the beginning or end of a file. For example, apple w/10 xlastword would search for apple within 10 words of the end of a document.