7

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

1 Answer 1

11

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
3
  • So did this work for you? Aug 17, 2013 at 13:25
  • 1
    Yes it solved the problem
    – Daniel
    Aug 19, 2013 at 22:45
  • I avoided an iisreset by restarting the Search service
    – Lance
    Jul 6, 2018 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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