Sunday, 21 December 2025

Fixing the “Refinement Filters Limit (100)” Issue in SharePoint Search Using JavaScript

Issue:

Receently we were working PNP search webparts. When working with SharePoint Search refiners, you may eventually run into a frustrating limitation: by default, SharePoint only returns up to 100 refinement values (also known as refinement tokens or bins).

This becomes a problem when your refiners (e.g., tags, categories, metadata) exceed 100 values — because your script will simply never receive anything beyond the default limit. In this blog, we’ll break down why this happens, and more importantly, how to force SharePoint Search to return more than 100 refinement values using JavaScript and REST API.

Analysis:

SharePoint’s search engine applies an internal limit of 100 refinement results.

So even if your managed property (e.g., RefinableString01) contains 500 unique values, SharePoint will only send the first 100 — unless you explicitly override that limit. 

This behavior is by design to protect performance, but when developers need the complete refinement list (for filters, dropdowns, analytics, etc.), the default limit becomes restrictive.

Solution:

When calling the SharePoint REST Search API:
 /_api/search/query  

You must modify the refiners parameter by appending:
 (filter=1000/0/*)  

What these parameters mean
  1. filter=1000 - Maximum number of refinement values to retrieve (use high numbers like 1000)
  2. 0 - Threshold (0 = no threshold)
  3. * - Sorting order (default)
This bypasses the default 100 results limit and allows SharePoint to return the full set of refinement bins — up to the platform’s internal max.


Below is code sample: 

 const refinerName = "RefinableString01";  
 // Syntax: ManagedProperty(filter=count/threshold/sort)  
 // 1000 = max refinement bins  
 const url = `/_api/search/query?querytext='*'&refiners='${refinerName}(filter=1000/0/*)'`;  
 fetch(url, {  
   headers: { "Accept": "application/json;odata=verbose" }  
 })  
 .then(response => response.json())  
 .then(data => {  
   // All refinement bins are available here  
   console.log(data.d.query.PrimaryQueryResult.RefinementResults);  
 });  

Reference:

Fixing the “Refinement Filters Limit (100)” Issue in SharePoint Search Using JavaScript

Issue: Receently we were working PNP search webparts. When working with SharePoint Search refiners, you may eventually run into a frustratin...