In office 365 I get Search results using the following query

https://domain.com/_api/search/query?querytext='Title: Design' 

What I would like to be able to do is add an or condition for more than one properties in the query text e.g. If I need to search files that have a property Name i.e.'Filename' using the following query

'https://domain.com/_api/search/query?querytext='FileName: Design'

I get File 1, File 2, file 3

Now if I search for Title

https://domain.com/_api/search/query?querytext='Title: Design '

e.g I get File 2 File 5, File 6

I need to get all the files not just the common files in the search.

https://domain.com/_api/search/query?querytext='Title: Design + FileName: Design' 

Adding the + operator gives me only results common in both the queries

I apparently need to do

https://domain.com/_api/search/query?querytext='Title:Design plus results of Filename:Design'

So that i get File 1, File 2, file 3, File 5, File 6

Is there any other way to build queries instead of using the method above.

  • Try querttext='or(Title: Design,FileName: Design)' – Amal Hashim Nov 27 '14 at 15:20
  • 1
    Thank you for the response I tried it, but does not work with for querttext='or(Title: Design*,FileName: Design*) instead querttext=Title: Design OR FileName: Design* worked. Is the wildcard character the issue here. – user1339913 Nov 28 '14 at 10:15
  • I have a file with some custom properties in Shared Documents folder in sharepoint and also I need to search the file using the custom properties in rest api php, I also tried the above example but its not showing any results but showing some reponses – Manoj Jun 19 '15 at 12:30
  • The OR operator worked for me too. Thanks @user1339913 – Sagar Feb 28 '19 at 10:09

Your Answer

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

Browse other questions tagged or ask your own question.