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

Bootcamp Full 0 Reputation points
2023-09-14T18:12:36.2+00:00

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.
11,796 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,065 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,624 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,901 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChengFeng - MSFT 5,020 Reputation points Microsoft Vendor
    2023-09-15T06:07:40.83+00:00

    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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.