79500421

Date: 2025-03-11 10:36:11
Score: 0.5
Natty:
Report link

why wouldn't contains() or endswith() be indexed as well?

NOTE: contains() and endswith() are NOT indexed because they require scanning every row, making them slow. SharePoint does not support reverse or full-text indexing in Graph API, which would be needed for contains() and endswith(),

Recommended way is to use startswith() for fast Graph API queries For more details Refer this QnA.

startswith() is indexed because SharePoint stores data in sorted and indexed structure, allowing quick lookups without scanning the entire dataset, which makes more efficient compared to contains() and endswith() .

Generated the access token and used the same $filter query with startswith():

GET https://graph.microsoft.com/v1.0/sites/<site-id>/lists/<list-id>/items?$filter=startswith(fields/FileLeafRef, 'query')

enter image description here

Reference:

Microsoft QnA Blog on startswith

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): why wouldn't
  • Low reputation (0.5):
Posted by: Pratik Jadhav