Implementing Solr Search in Sitecore 8.

I started following the step from the below community Links, Here i will share the challenges i faced during implementing solr blogs.

  1. If you are installing the Bitnami Version higher than 5.0 and above, you won’t find the Schema.xml file. In Solr 5 you have to create the schema file by duplicating and renaming the managed-schema file.
  2. Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> SolrNet.Exceptions.SolrConnectionException: <response><lst name=”responseHeader”><int name=”status”>400</int><int name=”QTime”>2</int></lst><lst name=”error”><lst name=”metadata”><str name=”error-class”>org.apache.solr.common.SolrException</str><str name=”root-error-class”>org.apache.solr.common.SolrException</str></lst><str name=”msg”>undefined field _indexname</str><int name=”code”>400</int></lst></response>

    I made the 2 changes to resolve this by deleting the managed-schema file “C:\Bitnami\solr-5.5.0-1\apache-solr\solr\social_messages_master” from this location. Also I generated the schema file by Sitecore8.1 versions.

  3. <?xml version=”1.0″ encoding=”UTF-8″?> <response> <lst name=”responseHeader”><int name=”status”>400</int><int name=”QTime”>1</int></lst><lst name=”error”><lst name=”metadata”><str name=”error-class”>org.apache.solr.common.SolrException</str><str name=”root-error-class”>org.apache.solr.common.SolrException</str></lst><str name=”msg”>ERROR: [doc=sitecore://core/{30280196-aaf6-4bd6-85f8-557827a31c8f}?lang=ja-jp&amp;ver=1&amp;ndx=sitecore_core_index] unknown field ‘click_t_ja'</str><int name=”code”>400</int></lst> </response>Source: SolrNet

    In Sitecore8.1 the Schema.xml doesn’t contain the language field, for that you need to follow the Step 5 mentioned in Optional Sections, and restart the Solr.<dynamicField name=”*_t_ja” type=”text_general” indexed=”true” stored=”true” />

  4. I faced big problem in restarting the solr server. Finally I found the way, you just need to go in Bitnami Application and click on Manage Server Tab, from here you can Start, Stop and Restart the applicationsApacher
  5. Most of the error you will find when you will Rebuild Search Index, I suggest first time go to Control panel-> Indexing manager and check whether all the index are displayed on left hand side and Rebuild the Index one by one….If the Index are successful you will see the Index are created in the “C:\Bitnami\solr-5.5.0-1\apache-solr\solr\sitecore_web_index\data\index” folder.control Panel
  6. “Connection error to search provider [Solr] : Unable to connect to [http://localhost:8080/solr], Core: [sitecore_analytics_index]”.
    1. For above error you need to check whether you have properly created core in Solr.
    2. Solr by default work on 8983 port, you can check by putting the given url in browser. http://localhost:8983/solr/#/
    3. You can find the setting in solr.conf file (C:\Bitnami\solr-5.5.0-1\apache-solr\conf)
    4. In Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config: you need to change the Base Address. <setting name=”ContentSearch.Solr.ServiceBaseAddress” value=”http://localhost:9999/solr&#8221; /> – set port accordingly
  7. ERROR Object reference not set to an instance of an object.
    Exception: System.NullReferenceException
    Message: Object reference not set to an instance of an object.
    Source: SolrNet
    at SolrNet.Schema.SolrSchemaParser.Parse(XDocument solrSchemaXml)
    at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize()

    If you get the above error that means you haven’t loaded the proper Schema.xml file, Kindly regenerate the schema.xml or check whether there is error in Bitnami log file when core are loaded

  8. When you creating the core folder, don’t forget to make change in “” file, Other you will get error in Bitnami log\:\\Bitnami\\solr-5.5.0-1\\apache-solr\\solr\\social_messages_web\\conf\\solrconfig.xmlschema=C\:\\Bitnami\\solr-5.5.0-1\\apache-solr\\solr\\social_messages_web\\conf\\schema.xmldataDir=data
  9. Finally I ran the code given in the below blog and I got the result.
    You can also find how the Search Query is fired in Solr, in Search.log

    file.5496 18:33:48 INFO Query – firstname_t:(Amit)
    5496 18:33:48 INFO Serialized Query – ?q=firstname_t:(Amit)&rows=2147483647&fl=*,score&fq=_indexname:(sitecore_web_index)




One thought on “Implementing Solr Search in Sitecore 8.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.