SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a KQL query used with KeywordQuery that used to work in SP 2010 but no longer works in 2013:

scope="All Sites" AND path:"/sites/" AND path:"/Pages/ThisPage.aspx"

The error that’s given is:

The allowed range of values is 0 to 500    Parameter name: RowLimit
  at Microsoft.Office.Server.Search.Query.QueryProperties.ValidateRowLimit(Int32 value)
  at Microsoft.Office.Server.Search.Query.QueryProperties.set_RowLimit(Int32 value)

I need to set RowLimit to 1000, but I don’t know why there is a limit of 500. Decompiling the code for Microsoft.Office.Server.Search.Query.QueryProperties, RowLimit is compared against a property called MaxRowLimit which defaults to 10000, so I suppose that value is being set by some other means (I'm not modifying the value from the default)

My decompiler suggests that MaxRowLimit is set in a few ways:

  • this.MaxRowLimit = cachedSearchServiceApplicationInfo.MaxRowLimit;
  • this.MaxRowLimit = cachedSearchServiceApplicationInfo.DiscoveryMaxRowLimit;
  • By setting the Query property
  • During internal cloning

I've checked the service application but can't see a way to set a max row limit for that application.

Is this a search service application configuration issue?

Update: I followed this blog post to check the Max setting using powershell and the result was 10000:

PS> $ssa = Get-SPEnterpriseSearchServiceApplication
PS> $ssa.GetSetting('Config:qp_MaxResultsReturned')
share|improve this question
up vote 5 down vote accepted

Decompiling the SearchServiceApplication we see that MaxRowLimit on that application defaults to 500 and that value is passed to the query.

The SearchServiceApplication MaxRowLimit can be modified as follows:

PS> $ssa = Get-SPEnterpriseSearchServiceApplication
PS> $ssa.MaxRowLimit = 1000
PS> $ssa.Update()
PS> iisreset
share|improve this answer
So did this work for you? – Andrey Markeev Aug 17 '13 at 13:25
Yes it solved the problem – Daniel Aug 19 '13 at 22:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.