SharePoint 2013 Search Result Source - Microsoft.Office.Server.Search.Que ry.Pipeline.Connectors.OpenSearchR eaderConnector : Response length exceeded maximum length

Hi Everyone,

I got this error when I use search result webpart with the custom Search Result Source created at Search Service application level.

Microsoft.Office.Server.Search.Query.Pipeline.Connectors.OpenSearchReaderConnector : Response length exceeded maximum length

When I query search service database with the query like this

Select * from MSSSources

From the query result I saw that for all the pre-defined SP search result source the MaximumResponseLength is always 2147483647 but for all the custom result source I create no matter what protocol it's Local SharePoint Sites, Open Search, Exchange the field MaximumResponseLength is always 64 (KB I guess) and there's no field on the UI let me change this value.

Could this be a problem to my error above? I guess I can change the value for field MaximumResponseLength using PowerShell or db script and see if it works, but I'd like to ask if anyone had the same experiences with it and any side affects when changing this value?

Thank you,


January 12th, 2014 11:19pm

Look like a bug in SP? I found this code

// Type: Microsoft.Office.Server.Search.Query.Pipeline.Connectors.OpenSearchReaderConnector
// Assembly: Microsoft.Office.Server.Search.Query, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c
// MVID: 7245AE1F-E47A-422A-8579-262A7E967C20
// Assembly location: C:\Temp\Microsoft.Office.Server.Search.Query.dll


namespace Microsoft.Office.Server.Search.Query.Pipeline.Connectors
  internal class OpenSearchReaderConnector : IUrlConnector
    private static string componentName = typeof (OpenSearchReaderConnector).FullName;

// This is int because it's set to HttpWebRequest.MaximumResponseHeadersLength which is int number
    public int? MaximumResponseLength { get; set; }

public XDocument GetXmlFromUrl(string url)

if (this.MaximumResponseLength.HasValue && httpWebResponse.ContentLength > (long) (1024 * this.MaximumResponseLength.Value))
          throw new WebException(string.Format("Response length exceeded maximum length: [url={0}], [MaximumResponseLength={1}], [ReceivedResponseLength={2} bytes]", (object) url, (object) httpWebRequest1.MaximumResponseHeadersLength, (object) httpWebResponse.ContentLength), WebExceptionStatus.MessageLengthLimitExceeded);

So if the MaximumResponseLength is set to  2147483647 then SP will always throw the exception so I believe the code should be

if (this.MaximumResponseLength.HasValue && httpWebResponse.ContentLength > (1024 * (long) this.MaximumResponseLength.Value))

I find the safe number to set to MaximumResponseLength is 655360

Free Windows Admin Tool Kit Click here and download it now
January 13th, 2014 3:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics