alldocs (query all documents)

The <alldocs/> wildcard lets you run queries on all documents in a docbase, except those in the specified index. It can only be used as the first element of an andnotkey operator.

For example, to search all documents for references to sports stars named "Williams" but to exclude Grand Prix racer "W. Williams", create the following query:

<?xml version="1.0" encoding="UTF-16"?>
<query RESULTSPACE="R1" VERSION="4.5">                    
   <andkey>
      <!-- Retrieves all the documents in the Sports index, except those 
           for Motor Racing --> 
      <andnotkey>
         <alldocs/>
         <key NAME='Sports'><elem>Motor Racing</elem></key>
      </andnotkey>
      <!-- Retrieves the documents that contain the name Williams -->
      <key NAME='Names'>
         <elem>Williams</elem>  
      </key>
   </andkey>
</query>   

Where:

  • <andkey>, <andnotkey>, and <alldocs/> are the required elements to open the query. The <alldocs/> wildcard must be the first element of the <andnotkey> operator.
  • <key Name='Sports''> and the string Motor Racing apply the query to all values in the Sports index, except those in the Motor Racing index.
  • Williams points to the name that is being searched.
The <alldocs/> wildcard can also be used to find documents that do not contain any values for a particular index. For example, the following query retrieves all documents without dates:
<?xml version="1.0" encoding="UTF-16"?>
<query VERSION="4.5" RESULTSPACE="R1"> 
   <andnotkey> 
      <alldocs/> 
      <key NAME="Date"><allvalues/></key> 
   </andnotkey> 
</query>