SOLVED

What is limit of SharePoint Search API for post method ?

Brass Contributor

Hi,

 

Is there any documentation available where I can find limitations around SharePoint Online Search API post method for below mentioned point :

  • Payload size
  • How many sites can be included in query ?
  • Query text length ?
  • Request Header limitation ?
  • Is there any performance impact if specified limits are crossed ?

Thanks in advance for valuable inputs !

 

Regards,
Pratik

2 Replies
best response confirmed by pratikdarak21 (Brass Contributor)
Solution

@pratikdarak21 

The SharePoint Online Search API has certain limitations and guidelines you should be aware of, particularly when using the POST method. Below are the key limitations and considerations based on the documentation and practical usage of the SharePoint Online Search API:

1. Payload Size

The maximum payload size for a POST request to the SharePoint Online Search API is 2MB. This includes the entire HTTP request body, which consists of the query text, any additional parameters, and any other metadata you are sending.

2. Number of Sites Included in a Query

While there is no explicit limit on the number of sites that can be included in a query, the practical limit is determined by the complexity and size of the query payload. Since the entire payload must be within the 2MB limit, including too many sites or complex query structures could cause you to hit this limit.

3. Query Text Length

The maximum length of the query text (the "querytext" parameter) is 4096 characters. This limit ensures that the query remains manageable and performant.

4. Request Header Limitation

The total size of the request headers must be within reasonable limits, generally around 8KB. This includes all HTTP headers sent with the request. While this limit is not strictly enforced, large headers can contribute to overall request size and impact performance.

5. Performance Impact of Exceeding Limits

Exceeding these limits can result in various issues:

  • Request Failure: If the payload size exceeds 2MB or the query text exceeds 4096 characters, the request will fail.
  • Performance Degradation: Very large queries or excessive header sizes can lead to slower response times and potential timeouts. This is especially true for complex queries that require extensive processing.
  • Throttling: SharePoint Online employs throttling mechanisms to ensure fair use of resources. Exceeding recommended limits can trigger throttling, resulting in slower performance or temporary blocks on further requests.

Documentation and References

For the most accurate and detailed information, refer to the official Microsoft documentation and related resources:

  1. SharePoint Search REST API: Provides an overview of the REST API and links to related topics.
  2. Using the SharePoint Search Query APIs: Detailed guidelines on using the search query APIs.
  3. SharePoint Online and OneDrive for Business software boundaries and limits: Includes limits and boundaries for various aspects of SharePoint Online.

Summary

To ensure optimal performance and avoid issues when using the SharePoint Online Search API, keep the following points in mind:

  • Payload Size: Stay within the 2MB limit.
  • Number of Sites: Keep the query manageable and within the payload size limit.
  • Query Text Length: Limit to 4096 characters.
  • Request Headers: Keep total header size reasonable, ideally under 8KB.

By adhering to these guidelines, you can effectively use the SharePoint Online Search API while maintaining performance and reliability. The text was created with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

Thank you for detailed information :)
1 best response

Accepted Solutions
best response confirmed by pratikdarak21 (Brass Contributor)
Solution

@pratikdarak21 

The SharePoint Online Search API has certain limitations and guidelines you should be aware of, particularly when using the POST method. Below are the key limitations and considerations based on the documentation and practical usage of the SharePoint Online Search API:

1. Payload Size

The maximum payload size for a POST request to the SharePoint Online Search API is 2MB. This includes the entire HTTP request body, which consists of the query text, any additional parameters, and any other metadata you are sending.

2. Number of Sites Included in a Query

While there is no explicit limit on the number of sites that can be included in a query, the practical limit is determined by the complexity and size of the query payload. Since the entire payload must be within the 2MB limit, including too many sites or complex query structures could cause you to hit this limit.

3. Query Text Length

The maximum length of the query text (the "querytext" parameter) is 4096 characters. This limit ensures that the query remains manageable and performant.

4. Request Header Limitation

The total size of the request headers must be within reasonable limits, generally around 8KB. This includes all HTTP headers sent with the request. While this limit is not strictly enforced, large headers can contribute to overall request size and impact performance.

5. Performance Impact of Exceeding Limits

Exceeding these limits can result in various issues:

  • Request Failure: If the payload size exceeds 2MB or the query text exceeds 4096 characters, the request will fail.
  • Performance Degradation: Very large queries or excessive header sizes can lead to slower response times and potential timeouts. This is especially true for complex queries that require extensive processing.
  • Throttling: SharePoint Online employs throttling mechanisms to ensure fair use of resources. Exceeding recommended limits can trigger throttling, resulting in slower performance or temporary blocks on further requests.

Documentation and References

For the most accurate and detailed information, refer to the official Microsoft documentation and related resources:

  1. SharePoint Search REST API: Provides an overview of the REST API and links to related topics.
  2. Using the SharePoint Search Query APIs: Detailed guidelines on using the search query APIs.
  3. SharePoint Online and OneDrive for Business software boundaries and limits: Includes limits and boundaries for various aspects of SharePoint Online.

Summary

To ensure optimal performance and avoid issues when using the SharePoint Online Search API, keep the following points in mind:

  • Payload Size: Stay within the 2MB limit.
  • Number of Sites: Keep the query manageable and within the payload size limit.
  • Query Text Length: Limit to 4096 characters.
  • Request Headers: Keep total header size reasonable, ideally under 8KB.

By adhering to these guidelines, you can effectively use the SharePoint Online Search API while maintaining performance and reliability. The text was created with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

View solution in original post