Question

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:

ArgumentOutOfRangeException:
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')
10000
Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top