1

I am attempting to build a powerapp on top of a sharepoint list that can do both full text searching of documents and filter by metadata in the document library.

I am currently stuck on being able to search by the contents of documents in the library. I am able to search for documents via the UI, but cannot do so via the API.

My URL in the UI looks like so : https://XXX.sharepoint.com/sites/TestSite/Test%20Library/Forms/AllItems.aspx?view=7&q=banana

Where I have a word document with the text "banana" inside of it.

enter image description here

This returns without issue. I assumed that I could do the following to atleast search everywhere for the word banana within my site (Before narrowing it down to my document library).

https://XXX.sharepoint.com/sites/TestSite/_api/search/query?queryText='banana'

However this never returns any results (Although it does return a huge XML document).

enter image description here

If I search for my name, I do get results back because I presume it's returning users and other metadata related to my profile, but for the life of me I cannot seem to get document library full text search working through the API.

1 Answer 1

0

First thing you can try is to use something like this: queryText='(banana*)'

At least this is what the Sharepoint web application does when you enter „banana“ in the search text field at the top of your site, list or library.

Secondly I can strongly recommend the „SharePoint SearchQuery“ tool, which helped me a lot to refine and evaluate my API calls. https://github.com/pnp/PnP-Tools/releases

Finally here‘s my (more complex) query which I‘m using in one of my PowerAutomate flows. Please note that I'm additionally filtering the file typ "zip" in this query using the URL parameter "refinementfilters". enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.