title: Is it possible to modify plaintext search on a plaintext index into ciphertext search on a ciphertext index and have it work the same way?
body: <p>One of the answers to <a href="https://stackoverflow.com/questions/2705670/how-does-lucene-work">this</a> question does a good job in explaining how <a href="https://lucene.apache.org/" rel="nofollow noreferrer">Apache Lucene</a> works, especially the response by Tom Taylor.  Here is Tom's response:</p>
  <blockquote>
  <p>Lucene creates a reverse index something like</p>
  <p>File 1 :</p>
  <p>Term : Random</p>
  <p>Frequency : 1</p>
  <p>Position : 0</p>
  <p>Term : Memory</p>
  <p>Frequency : 2</p>
  <p>Position : 3</p>
  <p>Position : 6</p>
  <p>So it is able to search and retrieve the searched content quickly.
  When there is too many matches for the search query it outputs the
  result based on the weight. Consider the search query &quot;Main Memory&quot; it
  searches for all 4 words individually and the result would be like,</p>
  <p>Main</p>
  <p>File 1 : Frequency - 1</p>
  <p>Memory</p>
  <p>File 1 : Frequency - 2</p>
  <p>File 2 : Frequency - 1</p>
  <p>The result would be File1 followed by File2.</p>
  </blockquote>
  <p><strong>My question:</strong> Will the above still work if I decide to encrypt &quot;Random&quot; and &quot;Memory&quot; into ciphertext? When I say &quot;still work&quot;, I am asking will the search results still be File 1 and File 2 if I search for the cipher text of &quot;Main&quot; and &quot;Memory&quot; ?</p>
  <p>In essence, I am asking if it is possible to encrypt the entire Lucene index and use it to perform searches on encrypted queries.</p>