MS Graph search in Path not finding results

Stan 0 Reputation points
2024-07-18T11:40:36.1166667+00:00

I've been trying to create a search function that will look in MS Graph Sharepoint to find a file within a specific folder. Consider the following search/query endpoint body:

https://graph.microsoft.com/v1.0/search/query

{  
  "requests": [
        {
            "entityTypes": [
                "driveItem"
            ],
            "query": {
                "queryString": "\"niels\"",
                "queryTemplate": "({searchTerms}) Path:\"https://<sharepoint site>/Shared%20Documents/Sharepoint/bemetdocrepo/Calculations/2023-07/00888 [633]\""
            }
        }
    ]
}

In the folder 00888 [633] I have 5 files:

sharepoint

And when i run the query it find the verslag Niels.docx, but if i look for Blobsize i don't get any result. PCF and testcalc_ also don't give any result back...

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,987 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,675 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 24,716 Reputation points Microsoft Vendor
    2024-07-19T02:55:29.34+00:00

    Hi @Stan ,

    Reopen the graph explorer to search the file/folder by using below codes(Remember to replace your own site and file path):

    {
        "requests": [
            {
                "entityTypes": [
                    "driveItem"
                ],
                "query": {
                    "queryString": "\"testcalc_\" path:\"https://yourdomain.sharepoint.com/sites/yoursite/Shared%20Documents/1\""
                }
            }
        ]
    }
    

    Output:

    User's image

    User's image


    If the answer is helpful, please click "Accept as 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.


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.