Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Problems with a search functionality


I have a EPiServer 7 site that has a word search for pages. That is a very basic search page which code comes from old AlloyTech demosite. Search works fine when tested in localhost but when the same site is running in a demo server (a different place that is), a word search founds nothing on any pages. In the demo server there is EPiServer Search installed. What could cause this? What things in code should I check for – or what should I check in general? For this to work searchable pages should be indexed?

There is though (at least) one difference between the sites. The localhost site was created by using EPiServer project template of Visual studio but the basis for demo server’s site is done with EPiServer Deployment center. So that means that the localhost site stores indexed files in:

EPiServerFramework.config: <appData basePath=”..\AppData” />

and the demo server stores them in:

EPiServerFramework.config: <appData basePath=”C:\EPiServer\VPP\SiteName” />

This is just a guess but could this be the cause for the problem?

Any ideas and/or hints are welcome…

Dec 07, 2012 13:15

Check if you can reach your indexing service. Try to add your domain to the hosts file and point it to localhost.

Check your index to see if it has any content in it. You should be able to use LUKE I think.

Dec 07, 2012 15:19

Are you using the SearchDataSource or the index based search?

Dec 08, 2012 5:07

I'm using SearchDataSource. Whether is essential or not, but Search.aspx looks like this:

<asp:Panel DefaultButton="SearchButton01" CssClass="searchpanel01" runat="server">
  <asp:TextBox ID="SearchTextBox01" runat="server" />
  <asp:Button ID="SearchButton01" OnClick="SearchButton01_Click" runat="server" />

<EPiServer:SearchDataSource ID="Searcher01" PageLink="<%# EPiServer.Core.PageReference.StartPage %>" runat="server">
    <asp:ControlParameter ControlID="SearchTextBox01" Name="SearchQuery" PropertyName="Text" />

<asp:ListView DataSourceID="Searcher01" ID="ListViewSearch" runat="server" OnItemDataBound="ListViewSearch_ItemDataBound">
    <p><EPiServer:Translate Text="/search/results" runat="server" /></p>
    <p id="itemPlaceHolder" runat="server"></p>
    <EPiServer:Property ID="SearchProp02" PropertyName="PageLink" CustomTagName="h3" CssClass="search_itemtitle" runat="server" />
    <asp:Literal ID="previewText" runat="server" />
    <EPiServer:Property ID="SearchProp03" PropertyName="Introduction" Visible="false" runat="server" />
    <EPiServer:Property ID="SearchProp04" PropertyName="MainBody" Visible="false" runat="server" />
    <p><EPiServer:Translate Text="/search/noresults" runat="server" /></p>

...and its codebehind:

protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
//save the contents of querystring to string
string searchQuery = Request.QueryString["search"];
//...and if string isn't empty or that there is something written in the textbox (header.ascx)
if (searchQuery != null)
//put the content of querystring to a searchpage's textbox
SearchTextBox01.Text = searchQuery;
//...and do the search

if (CurrentPage.LanguageID == "fi")
//search only Finnish pages
Searcher01.LanguageBranches = "fi";
SearchButton01.Text = "Hae";
else if (CurrentPage.LanguageID == "en")
//search only English pages
Searcher01.LanguageBranches = "en";
SearchButton01.Text = "Search";

protected void ListViewSearch_ItemDataBound(object sender, ListViewItemEventArgs e)
Property searchProp03 = (Property)e.Item.FindControl("SearchProp03");
Property searchProp04 = (Property)e.Item.FindControl("SearchProp04");
Literal previewText = (Literal)e.Item.FindControl("previewText");

//show the contents of property "introduction" in literal
//but limit the amount of text shown (parameter "maxTextLengthToReturn" of StripHtml)
if (searchProp03.InnerProperty != null && searchProp03.InnerProperty.Value != null)
previewText.Text = "<p class=\"search_itemtext\">" + TextIndexer.StripHtml(searchProp03.InnerProperty.Value.ToString(), 230) + "</p>";
//if there isn't content in "Introduction", show the contents of property "MainBody" instead
//...and limit the amount of text shown
else if (searchProp04.InnerProperty != null && searchProp04.InnerProperty.Value != null)
previewText.Text = "<p class=\"search_itemtext\">" + TextIndexer.StripHtml(searchProp04.InnerProperty.Value.ToString(), 230) + "</p>";

protected void SearchButton01_Click(object sender, EventArgs e)




Dec 10, 2012 8:19

A stupid question: how should I check whether or not I can reach the indexing service? :)

By the way, indexing works somewhat because if I'll add some image under the Global Files, I indexes the image to "C:/EPiServer/VPP/SiteName/SiteGlobalFiles" but when I create a new page and publish it, it doesn't get indexed under "C:/EPiServer/VPP/SiteName/Index/Main". At least there isn't any folder with the Date modified -date that would be the same date when the page was published.

Dec 10, 2012 12:41


Dec 10, 2012 15:26

I tried to access indexingservice via url. In localhost it finds it - or at least the browser shows this:

...but when I try same for site in demo server, the browser tells that page can't be loaded and it gives this error text:

Exception details:

ServiceActivationException: The service '/IndexingService/IndexingService.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item.

Stack trace:

[ServiceActivationException: The service '/IndexingService/IndexingService.svc' cannot be activated due to an exception during compilation.  The exception message is: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item.]
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
   at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)

[Inner exception ArgumentException: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item]
   at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item)
   at System.Collections.Generic.SynchronizedCollection`1.Add(T item)
   at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses)
   at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
   at IndexingServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
   at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

Nevertheless indexingserver's .svc-file is located in demo server in a following place:


So, should I do something in IIS or what...? :)

Dec 11, 2012 11:10

Do you have multiple bindings in IIS? For example * on port 17000 and then on 80? In that case you need to remove the binding for 17000 or add base address prefix filter just like the error says: system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters


Dec 11, 2012 11:16


I'm having problem to configure the FTS as well.
When I add the 

      add name="example" description="example" ipAddress="," ip6Address="" allowLocal="true|false" readonly="true|false" / 
      <add name="my-key" description="local" allowLocal="true" readonly="false" />
    <namedIndexes defaultIndex="default">
        <add name="default" directoryPath="C:\MyProject\Index" readonly="false" />


I get the following error:

The configuration section '' cannot be read because it is missing a section declaration

Is there a nice documentation/tutorial how to configure the FTS?

I have followed but with no luck.


Dec 11, 2012 12:23

Mohsen: It complains that it can't find a section declaration for the Add it and it should be fine:

<section name="" type="EPiServer.Search.IndexingService.Configuration.IndexingServiceSection, EPiServer.Search.IndexingService"/>

Although this should already be added automatically when you install the service on your site.

Dec 11, 2012 12:32

At least that line can be found in Web.config -file created by CMS 7. :)

Dec 11, 2012 12:39

Thanks Toni.

Stupid of me. Works now =)

Dec 11, 2012 12:40

I feel rather stupid now too. :) All that needed to do was add one line


in Web.config inside the <system.serviceModel> -tag. Like this:

        <binding name="IndexingServiceCustomBinding" maxBufferPoolSize="1073741824" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
          <readerQuotas maxStringContentLength="10000000" />
	<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>

 ...and after that searchpage started to find text in pages. Yeehaw! :P

Edited, Dec 11, 2012 13:20
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.