1

I have a list with the following fields: ID, Title, Location, Manager

I currently have search set up such that if I enter in a term, it returns all the items with that term in the Title:

../_api/web/lists/getbytitle('MyList')/items?$select=ID&$filter=substringof(%27MY_SEARCH_TERM%27,Title)

This works, but how would I update my query string so that it returns the items with my search term across all fields and not just on Title?

I've considered doing substringof(%27MY_SEARCH_TERM%27,Title) OR substringof(%27MY_SEARCH_TERM%27,Facility), etc. but this isn't manageable when there's a lot of fields in the list.

What's the best way to approach this?

1 Answer 1

1

You can make use of REST Search EndPoint and target the list path to search upon

Format is

http://server/_api/search/query?querytext='MY_SEARCH_TERM+path:"http://server/lists/MyList"'
1
  • The Search API produces a different XML format than the List one though. I'm only concerned/allowed to change the query. I'm expected to have the same XML structure.
    – Katie
    Jun 16, 2016 at 20:23

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.