SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using SP2010 I would like to define a search scope where documents are located in two locations. The results should only include two specific file types. What I want is

(Folder = "a" OR Folder = "b") AND (FileExtension = "c" OR FileExtension = "d")

Can I do this only with the Include and Require rules?

To be more precise: what I am currently trying is 4 rules: 1. Include FileExtension = "c" 2. Include FileExtension = "d" 3. Require Folder = "a" 4. Require Folder = "b" -> fails, because a file cannot be in two folders at the same time. In other words, what SharePoint does is (c OR d) AND a AND b.

share|improve this question

Yes you can do this with the KeyWordQuery Syntax:

Have a look at the follwing links for more details:

So your query should be something like:

(folder:a OR folder:b) AND (filetype:c OR filetype:d)

I am not sure about the exact name of the "folder" property. You will have to look it up in the managed properties for search.

share|improve this answer
I am not building a query. I would like to define a search scope, i.e. the set of potential query results. – Marc Jul 19 '12 at 14:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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