12 October, 2012

Relate+ or community search - Could not get search results for uri




I had a hard time finding out why the search service in EPiServer community (or relate+) did not return any search results. When investigating the EPiServer log (log4net) I found that the webserver returned 404 (not found) when trying to send the search request to the search service IndexingService.svc.

But it was possible to reach the service by entering its url in a web browser. (I got the "endpoint not found" error which means that I reached the service)

So it seemed crazy that it didn't work. It really should work (heard that before?)

I than analyzed the IIS-logs and found out that the 404 error that was reported in the EPiServer log really was an 404.15 error (Query String Too Long).

So I analyzed what was really sent to the search service, and found out that all groups that the user is a member of was sent in the request. Since we use AD-accounts the users were members of lots of groups and the query string became very long.

I solved it by adding the following to the generic system.webServer section of web.config.


<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxQueryString="10000" />
        </requestFiltering>
    </security>
</system.webServer>

Here is the error message I found in the EPiServer log


EPiServer.Search.RequestHandler.GetSearchResults - Could not get search results for uri 'http://{your site}/IndexingService/IndexingService.svc/search/?q=(EPISERVER_SEARCH_DEFAULT%3a(searchword*))+AND+(EPISERVER_SEARCH_ACL%3a(U%5c%3a415aa516%5c-1653%5c-46b0%5c-85c0%5c-2ee3faf5e08d)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+1b6bafd0%5c-44c4%5c-4b13%5c-bf29%5c-fe110c7c1110)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+21adf78a%5c-aba5%5c-452a%5c-9ebf%5c-c5cd345abc7e)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+5ee681c7%5c-f001%5c-4478%5c-a7b3%5c-62e6f6cca6a3)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+6ab59e8a%5c-47d6%5c-4d17%5c-aa83%5c-6bc3e0fba1ac)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+95ed85c7%5c-8982%5c-4b13%5c-913b%5c-967a10b9edf5)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+ac01b6a8%5c-a740%5c-4d69%5c-a523%5c-029133dd41c7)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+bc60d25e%5c-f254%5c-43d5%5c-93ef%5c-32527e5f849c)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+c2c78b48%5c-bc99%5c-4226%5c-b377%5c-86398f105ed1)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+cb229ec7%5c-8d31%5c-4000%5c-807c%5c-491fbc9e34fd)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+de2a5931%5c-5c58%5c-4fe6%5c-a183%5c-4f24d9f5dead)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+f6b18ceb%5c-eee8%5c-4b1a%5c-9248%5c-9eac2c759d56)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+fd39c628%5c-40eb%5c-4599%5c-b972%5c-da9dfda5b7d5)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aClub+members+fd984453%5c-54f0%5c-4daa%5c-aa3d%5c-9e9b6125b387)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aCommunityMembers)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aEveryone)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAuthenticated+Users)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aNETWORK)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aNTLM+Authentication)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aThis+Organization)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+AgdaEntre)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+Allow+Client+Removable+Drives)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+MailBox_Info)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+Microsoft+Office+2010)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+Microsoft+Outlook+2010)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+Microsoft+Snipping+Tool)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+yourcompanyIntra)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+yourcompanyIntra+Admins)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+yourcompanyIntra+Editors)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+yourcompanyIntra+Upload)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+XenApp+Desktop)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG+XenApp+OTP)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aAG_XenApp_VPN)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aDomain+Users)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-010)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-060)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-060%5c-Diego)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-080)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-130)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-130%5c-Projekt+G)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-130%5c-Projekt+G%5c-01)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-150%5c-GIAB_Info_diverse)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-200+SAP%5c-W)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aG%5c-IntranetAdmin)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3ayourcompany+HK)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3ayourcompany+Users)+OR+EPISERVER_SEARCH_ACL%3a(G%5c%3aUsers))&namedindexes=&offset=0&limit=10&format=xml&accesskey=local'. Message: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse()


11 October, 2012

This collection already contains an address with scheme http


When using EPiServer Community (relate+) on a site with several configured host header names the search stops working.

When trying to reach the search service through the browser (http://{my site}/IndexingService/IndexingService.svc/) I get the  "This collection already contains an address with scheme http" error

I fixed this issue by adding multipleSiteBindingsEnabled="true" to the serviceHostingEnvironment tag in web.config (it's locatated in the serviceModel tag)

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" >

02 October, 2012

Check if the page is in editmode in EPiServer 7


The official way to check if the page is in edit mode in EPiServer 7 is:
PageEditing.PageIsInEditMode


Another way might be to check the request parameter:
if (! string.IsNullOrEmpty(Request.Params["epieditmode"]))

      return true;