andnot (exclusion operator)

The andnot operator excludes specific values (words, strings, dates, times, or numbers) when retrieving documents. It retrieves documents that contain the first specified value and excludes the documents that also contain the other specified values.

The andnot operator is specified with the <andnot> element. Searched values are defined as children of <andnot> element.

This sample query retrieves documents that contain Gable, but excludes the documents that also contain Brando.

<?xml version="1.0" encoding="UTF-16"?>
<!-- andnotQuery.xml -->
<query VERSION="4.5" RESULTSPACE="andnotQuery"> 
   <key NAME="FullText"> 
      <andnot> 
         <elem>Gable</elem> 
         <elem>Brando</elem> 
      </andnot> 
   </key> 
</query>