You can search for terms that are near to one another in a document with the NEAR operator.
For example, to find all the documents where dog is within 6 words of cat, enter the following query:
'near((dog, cat), 6)'
The NEAR_ACCUM operator combines the functionality of the NEAR operator with that of the ACCUM operator. Like NEAR, it returns terms that are within a given proximity of each other; however, if one term is not found, it ranks documents according to the frequency of the occurrence of the term that is found.
Oracle Text Reference for more information about using the NEAR and NEAR_ACCUM operators