title: Combining Lucene Results with Entity Framework Results?
body: <p>Obviously, changes in a database will not reflect what is in an index all the time. Is anyone using EF with Lucene and combining the results of a Lucene search with results form the same search in EF? I understand you would only want to pull back results from EF that are not in the Lucene results.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I guess the best way to handle this would be to first search the Lucene index and get a list of results, then you would do a search like this for EF:</p>
  
  <p>Pseudo Code:</p>
  
  <pre><code>var result = (from ef in EntityFrameworkList
                        where !(from l in LuceneList
                                select l.documentId)
                               .Contains(ef.Id)
                        select ef);
  LuceneList.AddRange(result); 
  </code></pre>
  
  <p>For those who like method chains</p>
  
  <pre><code>var result = (EntityFrameworkList.Where(ef =&gt; !(LuceneList.Select(l =&gt; l.documentId))
                                                     .Contains(ef.Id)));
  </code></pre>