Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

Yes you can do this with the KeyWordQuery Syntax:

Have a look at the follwing links for more details: http://msdn.microsoft.com/en-us/library/ee872310.aspx http://msdn.microsoft.com/en-us/library/ff394509

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
add comment

Your Answer

 
discard

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.