I can't search for files in shapoint when using the api /v1.0/search/query

Bootcamp Full 0 Reputation points

My file has been uploaded to share point and I use api to search for this file.

but doesn't return any results.

Screenshot 2023-09-15 011159

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
2,110 questions
A Microsoft file hosting and synchronization service.
518 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
8,101 questions
Microsoft Graph Files API
Microsoft Graph Files API
A Microsoft API to create an app that connects with files across OneDrive, OneDrive for Business, and SharePoint document libraries.
393 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,268 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChengFeng - MSFT 3,765 Reputation points Microsoft Vendor

    Hi @ Bootcamp Full

    Judging from the question you provided, the cause of the problem is:

    There are spaces in the middle of your file name, and the spaces will be queried in chunks.

    Please enclose the file name "the a a" in double quotes to ensure that search engines see it as an exact matched phrase rather than a separate word. This will help you find files with exact file name matches.

    Here is a test for your reference:

    User's image

    Here is test result:

    User's image

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng