title: Lucene.Net - Get distinct categories
body: <p>I have created the following document:</p>
  
  <pre><code>var document = new Document();
  document.Add(new Field("category", "foo", Field.Store.YES, Field.Index.NOT_ANALYZED));
  ...
  </code></pre>
  
  <p>I have approx 10M documents which belong to 8 distinct categories. I would like to get all distinct categories (get all documents and read a value of <code>category</code> field) by executing search query. Is that feasible?</p>
  
  <p>Another approach is to create a list of categories at index rebuild and to write these values in database.</p>
  
  <p>Any help would be greatly appreciated!</p>