Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
SItecore + Solr 4.8.*

Sitecore 7 + Solr 4.8.*

The normal process when starting to use Solr + Sitecore is to take the example schema.xml (that comes with the Solr distribution) and use the schema generator (in the Sitecore control panel) to modify it.

In Solr 4.8.* the xml structure of the schema.xml file has changed slightly and this causes problems when we parse it.

  1. When Sitecore loads
  2. When we use Sitecore's schema generator

Previously fields and types were nested in a :

    <field />
    <fieldType />

..structure. This has now changed to a flat structure:

<field />
<type />

.. without the parent elements. This breaks the parsing of the file.

The good thing is that those parent nodes can be added back in without any problem.

  • Add <fields> before the first <field> element.

  • Add </fields> after the last <dynamicfield> element.

  • Add <types> before the first <fieldType> element.

  • Add </types> after the last <fieldType> element.

This issue should be fixed in a later version of Sitecore as this problem with parsing will be corrected.

Copy link

Hello Stephen,

Perfect! this works!
I am working on Solr 4.9 and it does not have any <type /> nodes, but I surrounded <fieldType /> nodes with <types> </types> and it works.


Copy link

Thanks mukteshm .. I fixed type typo <type> should have been <fieldType> :)

Copy link

csulham commented Dec 17, 2014

Hi Stephen,

I'm working on a 7.2 upgrade using Solr 4.9.1. The schema generated by Sitecore uses the pint field type, which will be deprecated in Solr 5.0. In 4.9 you can enable the pint field type by un-commenting it in the schema.xml. However, Sitecore should probably stop using this field type when generating the schema.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment