Anders Hattestad
Feb 9, 2016
  4122
(3 votes)

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=4.0.0.0, 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

Feb 09, 2016

Comments

Feb 9, 2016 04:25 PM

Forgetting to map up domain name in host file is another got ya. 

Ip filter that disallow localhost is a third I've bashed my head against  :)

Please login to comment.
Latest blogs
Creating an Optimizely CMS Addon - Adding an Editor Interface Gadget

In   Part One   of this series, I covered getting started with creating your own AddOn for Optimizely CMS 12. This covered what I consider to be an...

Mark Stott | Aug 30, 2024

Configure your own Search & Navigation timeouts

The main blog Configure your own Search & Navigation timeouts was posted for years but you need copy the code to your application. We now bring tho...

Manh Nguyen | Aug 30, 2024

Joining the Optimizely MVP Program

Andy Blyth has been honoured as an Optimizely MVP, recognising his contributions to the Optimizely community. Learn how this achievement will enhan...

Andy Blyth | Aug 29, 2024 | Syndicated blog

Welcome 2024 Summer OMVPs

Hello, Optimizely community! We are thrilled to announce and welcome the newest members to the Optimizely Most Valuable Professionals (OMVP) progra...

Patrick Lam | Aug 29, 2024

Create custom folder type in Edit Mode

Content Folders, which are located in assets pane gadget or multichannel content gadget, allow you to add any type of block or folders. But...

Grzegorz Wiecheć | Aug 28, 2024 | Syndicated blog

Creating an Optimizely AddOn - Getting Started

When Optimizely CMS 12 was launched in the summer of 2021, I created my first AddOn for Optimizely CMS and talked about some of the lessons I learn...

Mark Stott | Aug 28, 2024