title: Lucene sort by date descending
body: <p>I am trying to sort a Lucene search firstly by a boolean field and then by a datetime. I have this:</p>
  
  <pre><code>SortField[] sortFields = new SortField[]
    { 
      new SortField(LuceneMedia.IndexFields.IsPrivate, SortField.STRING, true),
      new SortField(LuceneMedia.IndexFields.DateAdded, SortField.STRING, true)
    };
  Sort sort = new Sort(sortFields);
  </code></pre>
  
  <p>The boolean field is being sorted correct, but the date seems a bit random.</p>
  
  <pre><code>SortField[] sortFields = new SortField[]
    { 
      new SortField(LuceneMedia.IndexFields.IsPrivate, SortField.STRING, true),
      new SortField(LuceneMedia.IndexFields.DateAdded, SortField.LONG, true)
    };
  Sort sort = new Sort(sortFields);
  </code></pre>
  
  <p>But now it seems to ignore the date and is ordering by the document title, which isn't part of the sort at all.</p>