Monday, 30 November 2015

Force Download of PDF in Sitecore

Make sure to have ForceDownload as true and disable the Range Retrival using below setting if needed.

<mediaType name="PDF file" extensions="pdf">  
  <mimeType>application/pdf</mimeType>  
  <forceDownload>true</forceDownload>  
</mediaType>  


<setting name="Media.EnableRangeRetrievalRequest" value="false"/>

Friday, 27 November 2015

Can we do swap of CORE for Given Sitecore Index

Yes we can have two cores for given sitecore index and can be swapped..


When Sitecore is configured to use 2 cores for particular index, it will use the primary one for retrieving search results. Every time you execute rebuild of the index, secondary core will be rebuilt and after the rebuild, cores will be switched - the rebuilt core will become new primary core, and the old primary core will become secondary core now.


Please refer the below url in order to have detailed understanding of the same.


http://www.skillcore.net/sitecore/using-switchonrebuildsolrsearchindex-solr-provider-for-sitecore



Thursday, 19 November 2015

Alias not working when changed

How to check Alias is active 

Settings.AliasesActive

How to check if alias exist

Database database = Context.Database;  
database.Aliases.Exists


Monday, 16 November 2015

Descendant and Ancestor axes are disabled. Set FastQueryDescendantsDisabled setting to false to enable these axes.

Suddenly this morning I started getting error

Descendant and Ancestor axes are disabled. Set FastQueryDescendantsDisabled setting to false to enable these axes.

When researched found there is a setting in web.config 

      <!-- FAST QUERY DESCENDANTS DISABLED
           Determines whether ability to select items through Ancestors/Descendants axes should be disabled in fast query.
           Default value: false
      -->
      <setting name="FastQueryDescendantsDisabled" value="false" />


Surprised that this setting has not been changed ; to invetigate further i searched FastQueryDescendantsDisabled invetigate whole root solution folder..

Then I found one more place where it was true..changed and life back to normal,

               Website\App_Config\Include\Sitecore.Publishing.Optimizations.config 



Please note 


As per sitecore fast query cheat sheet whenever we change this we should clean up the databases.


Note
If the FastQueryDescendantsDisabled setting, in the web.config file, is set to true and then changed back
to false, you must rebuild the Descendents table.
To rebuild the Descendents table, click Sitecore, Control Panel, Databases, Clean Up Database and run
the Clean Up Database wizard.




Monday, 2 November 2015