When EPiServer.Search dosen't work
I work locally and move the site to a test server, and the search didn't work.
The first problem was the http://IndexingService/IndexingService.svc gave an 500 error since it didn't find the handler for it. That was easy resolved by adding svg-Itegrated-4.0 handler.
<location path="IndexingService/IndexingService.svc"> <system.web> <httpRuntime maxQueryStringLength="65536" /> </system.web> <system.webServer> <handlers> <clear/> <add name="svc-Integrated-4.0" path="*.svc" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> <security> <requestFiltering> <requestLimits maxQueryString="65536" /> </requestFiltering> </security> </system.webServer> </location>
But the problem was there still. I got no hits from the search. I thought it maybe was something that would show in the log, but the log didn't add any lines. That was solved by editing the EPiServerLog.config and set the threshold for the appender to All since it by default is set to Error.
<log4net> <appender name="errorFileLogAppender" type="log4net.Appender.RollingFileAppender" > <!-- Consider moving the log files to a location outside the web application --> <file value="App_Data\EPiServerErrors2.log" /> <encoding value="utf-8" /> <staticLogFileName value="true"/> <datePattern value=".yyyyMMdd.'log'" /> <rollingStyle value="Date" /> <threshold value="All" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <appendToFile value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %level %logger: %message%n" /> </layout> </appender> <appender name="outputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender" > <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="[%thread] %level %logger: %message%n" /> </layout> </appender> <!-- Log page publish to find editor related errors. --> <logger name="EPiServer.Search.IndexingService"> <level value="All" /> </logger> <root> <level value="Error" /> <appender-ref ref="errorFileLogAppender" /> </root> </log4net>
But my zero hits didn't show in the log, or it showed that the index was responding, but gave 0 hits. Then it struck me that to get the index to work I need to copy the AppData/Index files to the new server. And it worked. So mental not to self, when deploying a local site to a test server copy the AppData/Index files also, or reindex the site again