title: Sitecore 6.6 and Lucene upgrade issue
body: <p>We recently upgraded to Sitecore 6.6 and are running into issues with the search and crawl functionality from Lucene since 6.6 uses a newer version and has some of the methods/functions have been made obsolete.</p>
  
  <p>The code below used to work fine with the previous version of Lucene.NET 2.3 but isn't working in 2.9. Can you tell us what we are doing wrong and help us rectify this piece of code? The error we get while compiling is</p>
  
  <pre><code>`Lucene.Net.Search.IndexSearcher` does not contain a definition for 'Search'
  and no extension method 'Search' accepting a first argument of type 
  `Lucene.Net.Search.IndexSearcher` could be found (are you missing a using 
  directive or an assembly reference?) 
  </code></pre>
  
  <p>This error happens on this line - <code>Sitecore.Search.SearchHits hits = new SearchHits(context.Searcher.Search(query,sort));</code>. I'm guessing that it will be a simple fix but I'm unsure of how to go  about fixing it.</p>
  
  <pre class="lang-cs prettyprint-override"><code>private static SearchResultCollection GetSearchResults(Query query, Sort sort, int startingIndex, int getCount, out int totalHits)
  {
      SearchResultCollection retVal = new SearchResultCollection();
      Sitecore.Search.Index searchIndex = Sitecore.Search.SearchManager.GetIndex("content");
      using (Sitecore.Search.IndexSearchContext context = searchIndex.CreateSearchContext())
      {
          Sitecore.Search.SearchHits hits = new SearchHits(context.Searcher.Search(query,sort));
          totalHits = hits.Length;
          //since index is zero based... adjust the numbers 
          startingIndex = (startingIndex - 1) * getCount;
          getCount = (getCount &gt; totalHits || totalHits &lt; startingIndex + getCount) 
              ? hits.Length - startingIndex : getCount;
          retVal = hits.FetchResults(startingIndex, getCount);
      }
      return retVal;
  }
  </code></pre>
  
  <p>Thanks</p>