title: What are the drawbacks of using a Lucene directory as a primary file store?
body: <p>I want to use a <strong>Lucene</strong> <a href="https://lucene.apache.org/core/7_2_0/core/org/apache/lucene/store/MMapDirectory.html" rel="nofollow noreferrer"><strong>MMapDirectory</strong></a> as a primary file store. Each file would be stored in a separate document as a <strong>byte array</strong> in a <a href="https://lucene.apache.org/core/7_2_0/core/org/apache/lucene/document/StoredField.html" rel="nofollow noreferrer"><strong>StoredField</strong></a>. All file properties that should be searchable, like file name, size etc., would be stored in indexable fields in the same document.</p>
  
  <p>My questions would be:</p>
  
  <ol>
  <li>What are the drawbacks of using Lucene directories for storing files, especially with regards to indexing and search performance and memory (RAM) consumption?</li>
  <li>If this is not a "no-go", is there a better/faster way of storing files in the directory than as a byte array?</li>
  </ol>