Friday, August 10, 2012

Sitecore 6.5 Upgrade follow-up

Overall the upgrade went really well. From a public-facing perspective it was pretty seamless and our content editors are definitely happy that they can now use the browser of their choice to do content editing. The only caveat I have found so far is that when I was trying to import windows-encoded csv files using chrome on the mac and my custom tool the characters were getting jacked up. Running the same code with the same file in IE on windows had no problem.

The biggest setback we suffered in the upgrade process was that our site search stopped working cold. This probably should have been obvious given the amount of articles from Alex & Sitecore about the Lucene Search impending obsolescence but I missed it for the most part. I pretty much thought that 'depricated' meant 'will still work' but for whatever reason our search just gave up the ghost. I had config errors with the indexes I had previously defined in our web.config so just commented it out in the initial pass and then forgot about the whole deal. I guess I should have reviewed the first note in my previous upgrade post but we got busy and it slipped off the list. Finally circling back around to this topic, I've been hunting the web for good info. The best info I found is a combination of these two links:


The first helped by getting me a config file that works:
 <configuration xmlns:x="http://www.sitecore.net/xmlconfig/">  
  <sitecore>  
   <databases>  
    <database id="web" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">  
     <Engines.HistoryEngine.Storage>  
      <obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel">  
       <param connectionStringName="$(id)" />  
       <EntryLifeTime>30.00:00:00</EntryLifeTime>  
      </obj>  
     </Engines.HistoryEngine.Storage>  
     <Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>  
    </database>  
   </databases>  
   <search>  
    <configuration>  
     <indexes>  
      <index id="web" type="Sitecore.Search.Index, Sitecore.Kernel">  
       <param desc="name">$(id)</param>  
       <param desc="folder">web</param>  
       <Analyzer ref="search/analyzer" />  
       <locations hint="list:AddCrawler">  
        <master type="Sitecore.SharedSource.Search.Crawlers.AdvancedDatabaseCrawler,Sitecore.SharedSource.Search">  
         <Database>web</Database>  
         <Root>/sitecore/content</Root>  
         <IndexAllFields>true</IndexAllFields>  
         <fieldCrawlers hint="raw:AddFieldCrawlers">  
          <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.LookupFieldCrawler,Sitecore.SharedSource.Search" fieldType="Droplink" />  
          <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.Search" fieldType="Datetime" />  
          <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.Search" fieldType="Date" />  
          <fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.NumberFieldCrawler,Sitecore.SharedSource.Search" fieldType="Number" />  
         </fieldCrawlers>  
         <!-- If a field type is not defined, defaults of storageType="NO", indexType="UN_TOKENIZED" vectorType="NO" boost="1f" are applied-->  
         <fieldTypes hint="raw:AddFieldTypes">  
          <!-- Text fields need to be tokenized -->  
          <fieldType name="single-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="multi-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="word document" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="html" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="rich text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="memo" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <!-- Multilist based fields need to be tokenized to support search of multiple values -->  
          <fieldType name="multilist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="treelist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="treelistex" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <fieldType name="checklist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
          <!-- Legacy tree list field from ver. 5.3 -->  
          <fieldType name="tree list" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />  
         </fieldTypes>  
        </master>  
       </locations>  
      </index>  
     </indexes>  
    </configuration>  
   </search>  
  </sitecore>  
 </configuration>  

While the second got me the code necessary to fire off the rebuild. The blog link was passing a string of "web" to the Sitecore.Jobs.JobOptions constructor which was not quite correct. I just copied the Builder object into my project, rebuilt and boom! indexes are rebuilding.

For the actual searching, I pulled down the Advanced Database Crawler code from Trac (http://trac.sitecore.net/AdvancedDatabaseCrawler/browser/Branches/v2/) and integrated that way. Still testing and dialing in but so far this looks promising and was only a couple of hours work to get from old style to new style Sitecore search.