0

I have a library with 7 folders. I want to include the results of my search from 4 folders only not all of the library. I need the query syntax what we need to use in search result web part as i don't see any documentation to work with folders for search query.

1

Update the Ahmad Zia’s reply:

You need to enter the query path:http://<server>/<site>/<libray>/<folder> without “Forms”.

For example:

path:http://sp/sites/team/Doc1/f1

path:http://sp/sites/team/Doc1/2018

(“Doc1” is the library name, “f1” and “2018” are folder names)

enter image description here

  • Yes, this seems to be perfect solution. I have another question, do we have any ability to use folder ID instead of name as 1 user he changed the name of the folder and the results were gone. – Sree Kuttan Dec 4 '17 at 13:16
0

The query syntax for multiple paths is

(path:"http://site/library/Forms/Forms1/*" OR path:"http://site/library/Forms/Forms2/*")

This should search only in two folders Forms1 and Forms2 of library. You can extend this for 7 folders

  • I don't think that's the syntax. The above answer was what worked for me. Thanks for your response – Sree Kuttan Dec 4 '17 at 13:18

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.