title: How does Solr's cursorMark solve deep pagination while being stateless?
body: <p>This question has been asked before but I'm not satisfied and I need further elaboration.</p>
  
  <p>These are the basic premises:</p>
  
  <ol>
  <li>cursorMark is stateless. It doesn't store anything on the server</li>
  <li>cursorMark is a computed value that tells whether to skip a document or not</li>
  </ol>
  
  <p>I'm not sure if I understood it properly but that's how I read the given explanations.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>If cursorMark is meant to know which documents to skip then how is this not a search? It basically is a search by running through a sequence of documents and asking the question "is this what I'm looking for or do I need to skip this?"</p></li>
  <li><p>Still related to the first question, how is this "sequence of documents" calculated? Isn't that stored in the memory? Or is cursorMark creating a temporary file stored on the disk?</p></li>
  <li><p>How does it calculate the next cursorMark if it doesn't remember about the entire universe of results?</p></li>
  </ol>
  
  <p>All I can see is that there's no escape.</p>
  
  <p>Either you store some state about your search results or perform search for each page requests.</p>
  
  <p>Related references:</p>
  
  <p><a href="https://stackoverflow.com/questions/28185133/cursormark-is-stateless-and-how-it-solves-deep-paging">cursorMark is stateless and how it solves deep paging</a></p>
  
  <p><a href="https://stackoverflow.com/questions/28109153/how-much-time-does-the-cursormark-is-available-on-solr-server">How much time does the cursorMark is available on solr server</a></p>
  
  <p><a href="http://yonik.com/solr/paging-and-deep-paging/" rel="nofollow noreferrer">http://yonik.com/solr/paging-and-deep-paging/</a></p>