title: Full Text Search with multiple index and complex requirements
body: <p>We are building an application which will require us to index data for each of our users so that we can provide full text search on their data. Here are some notable things about the application:</p>
  
  <p>A) The data for every user is totally unrelated to every other user. This gives us few advantages: </p>
  
  <ol>
  <li>we can keep our indexes small in
  size.</li>
  <li>merging/compatcting fragmented index
  will take less time.</li>
  <li>if some indexes becomes inaccessible
  for whatever reason (corruption?),
  only those users gets affected.
  Other users are unaffected and the
  service is available for them.</li>
  </ol>
  
  <p>B) Each user can have few different types of data. We want to keep each type in separate folders, for the same reasons as above.</p>
  
  <p>So, our index hierarchy will look something like:<br>
  <code>
  /user1/type1/&lt;index files&gt;<br>
   /user1/type2/&lt;index files&gt;<br>
   /user2/type1/&lt;index files&gt;<br>
   /user3/type3/&lt;index files&gt;</code></p>
  
  <p>C) Often, probably with every itereation, we'll add "types" of data that can be indexed.<br>
  So we want to have an efficient/programmatic way to add schemas for different "types". We would like to avoid having fixed schema for indexing. I like Lucene's schema-less way of indexing stuff.</p>
  
  <p>D) The users can fire search queries which will search either:
   - Within a specific "type" for that user
   - Across all types for that user: in this case we want to fire a parallel query like Lucene has. (<a href="http://lucene.apache.org/java/3_0_2/api/all/org/apache/lucene/search/ParallelMultiSearcher.html" rel="nofollow">ParallelMultiSearcher</a>) </p>
  
  <p>E) We require real time update for the index. <em>This is a must.</em></p>
  
  <p>F) We are are planning to shard our index across multiple machines. For this also, we want:<br>
   if a shard becomes inaccessible, only those users whose data are residing in that shard gets affected. Other users get uninterrupted service.</p>
  
  <p>We were considering Lucene, Sphinx and Solr to do this. This is what we found:</p>
  
  <ul>
  <li>Sphinx: No efficient way to do A, B,
  C, F. Or is there?</li>
  <li>Luecne: Everything looks possible, as
  it is very low level. But we have to
  write wrappers to do F and build a
  communication layer between the web
  server and the search server.</li>
  <li>Solr: Not sure if we can do A, B, C
  easily. Can we?</li>
  </ul>
  
  <p>So, my question is what is the best software for the above requirements? I am inclined more towards Solr and then Lucene if we get all the requirements.</p>