locked
Search Scope RRS feed

  • Question

  • I have Search Server 2010 stand alone installed. I have created 3 scopes - each pointing to a different filesystem repository. Each filesystem repository contains about 6 or 7 thousand word documents. I would like to be able to search with in each scope from my C# code and am having no joy. I need to be able to do wild card searches so I have been using the MSSQLFT query type.

    I have found some contraditory posts and articles out there for specifying the scope. So I have tried:

     

    <QueryPacket xmlns='urn:Microsoft.Search.Query'>
     <Query>
      <Range>
       <Count>0</Count>
      </Range>
      <Context>
        <QueryText type='MSSQLFT'>
         SELECT Title, Path, Description, Write, Rank, Size
         FROM scope() 
         WHERE "scope"='Pending' AND 
            CONTAINS(ALL, 'some word')
       </QueryText>
      </Context>
      <EnableSpellCheck>On</EnableSpellCheck>
     </Query>
    </QueryPacket>
    

     

    and

    <QueryPacket xmlns='urn:Microsoft.Search.Query'>
     <Query>
      <Range>
       <Count>0</Count>
      </Range>
      <Context>
        <QueryText type='MSSQLFT'>
         SELECT Title, Path, Description, Write, Rank, Size
         FROM scope('Pending') 
         WHERE CONTAINS(ALL, 'some word')
       </QueryText>
      </Context>
      <EnableSpellCheck>On</EnableSpellCheck>
     </Query>
    </QueryPacket>

    and a few other variations. All of them either throw a syntax error or return results from all of my scopes.

    Could someone point me towards an article or documentation or any resource really that could help me limit my scope?

    Thanks

    -Cam


    Thursday, April 14, 2011 2:30 PM

Answers

  • Found the answer.

    I had to explictly exclude all of the other search scrope from each other. So I have 3 scopes: Current, Pending and Public. Current explictly excludes Pending and Public. The other two do the same.

    I then had to go to the ViewScopes page (http://<server name>/_layouts/viewscopes.aspx) and click on the 'Display Groups' link and then add my scopes to each of the different search groups. I find this part odd since I am doing my query through C# code using the QueryPacket/MSSQLFT XML stuff. Why would QueryEx care if the site setup by Search Server (which no one will actually be using) has these search scopes visible to the interface that no one will be using? If there was a Query or QueryEx group from there then I could get behind that but adding it to the advanced search doesn't make much sense to me.

    -Cam
    • Marked as answer by escher4096 Wednesday, April 20, 2011 5:06 PM
    Wednesday, April 20, 2011 5:05 PM