title: Marklogic: Skipping xml document while performing queries
body: <p>I'm running XQuery in MarkLogic. The number of xml documents in the database is 764. The number of documents that the query returns results for is 382, which is the half of the number of documents available in the database. I've tried a simple code to make sure that this is actually happening:</p>
  
  <pre><code>declare namespace rec="http://apa.org/pimain";
  
  for $record at $index in /rec:Record 
  return $index
  </code></pre>
  
  <p>The last <code>$index</code> I'm getting is 382. I've made sure that the number of instances in the database is <code>764</code>. Any ideas?</p>
  
  <p>For data loading I've used Information Studio. These are the ingestion settings
  <a href="https://i.stack.imgur.com/ywG7K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ywG7K.png" alt="ingestion"></a></p>
  
  <p>The permissions
  <a href="https://i.stack.imgur.com/AFpW5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AFpW5.png" alt="permissions"></a></p>
  
  <p>The user is <code>nobody</code></p>