Seems like the Sitecore Solr search configuration and providers are still in their toddler stages. There are a few quirks, however, Sitecore is working hard to fix them. The following article describes one of the issues that I have discovered recently, while setting up a Solr solution for a client. The problem was related to the Web API DateTime calls and the new Media Library SPEAK browsing client interface. The article provides a fix package, which you want to keep handy, as there is no ETA on the fix being included in the Sitecore build yet.
Problem: Files not Showing up in Search Media Library SPEAK View
After following the steps outlined in the Sitecore Search Scaling Guide to setup Solr on my local development environment everything seemed to work fine, besides the Image field Browse button. Sitecore 7.1 has introduced a new SPEAK dialog for browsing assets in the Media Library using search (Sitecore is undergoing a face lift, slowly retiring the Sheer UI with more conventional HTML SPEAK framework). The new dialog now displays media assets using the search view, with an option to switch to the conventional structured view.
The problem we have encountered was that none of the assets were found when the Browse button was clicked, and we were forced to switch to the conventional hierarchical view to find the uploaded media files. In Sitecore logs I have also noticed the following error come up every time the Browse button was hit on an image field (other fields with the same functionality may have been affected as well):
ERROR [Item Web API] String was not recognized as a valid DateTime. Exception: System.FormatException Message: String was not recognized as a valid DateTime. Source: mscorlib at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) at Sitecore.ItemWebApi.Facets.UpdatedFacetProvider.GetFacetValue(String value) at Sitecore.ItemWebApi.Pipelines.Request.Search.GetFacets(IList`1 facetProviders, FacetResults facets) at Sitecore.ItemWebApi.Pipelines.Request.Search.RunSearchPipeline(RequestArgs args, String searchText, String languageName) at Sitecore.ItemWebApi.Pipelines.Request.Search.Process(RequestArgs args) at (Object , Object ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.ItemWebApi.Pipelines.HttpRequest.LaunchRequest.Process(HttpRequestArgs arguments)
How to Fix the Media Library Browser Issue with Solr.
After some time of digging through the search dlls with a reflector, the root of the issue seemed to be located in the Item Web API libraries. I have contacted the Sitecore Support and they were very quick to recognize the bug and provide the solution. Unfortunately, as usually, there is no ETA on the fix being included in the Sitecore build, until then the fix below should do the trick.
After a few tweaks, I have created a packaged fix. To resolve the Media Library Browse button issue please follow these steps:
- Download the Media Library Browser Fix for Solr Package
- Install the package using the Sitecore Installation Wizard.
- Rebuild all search indexes
After following the steps above, the Media Library SPEAK search browser should display the media items and the Web API errors should go away as well.
Hopefully this saved you hours of research. Happy coding!