开发者

How to programmatically search sharepoint 2010 for sites and folders?

Searching for sites and folders on SP2007 server works but not for SP2010. I've tried different settings in content administration (as found on some forums), but then too it doesn't work for SP2010. Tried some change with the embedded SQL query too, didn't help.

NOTE: Search query schema has been changed in SP2010.

Following query string I'm sending:

"<QueryPacket xmlns=\"urn:Microsoft.Search.Query\">"
    "<Query>"
    "    <SupportedFormats><Format>urn:Microsoft.Search.Response.Document:Document</Format></SupportedFormats>"
    "    <Context>"
    "        <QueryText type=\"MSSQLFT\" language=\"en-us\">"
    "           SELECT Path, Title, contentClass, SiteName"
    "           FROM SCOPE()"
    "           WHERE (FREETEXT(Title, '%s') OR FREETEXT(Path, '%s')) AND"
    "                 (contentclass = 'STS_Web' OR"
    "                  contentclass = 'STS_ListItem_DocumentLibrary' OR"
    "                  contentclass = 'STS_List_DocumentLibrary' OR"
    "                  contentclass = 'STS_ListItem_PictureLibrary' OR"
    "                  contentclass = 'STS_List_PictureLibrary') AND"
    "                 (IsDocument != 1) AND"
   开发者_运维百科 "                 (Path NOT LIKE '%%DispForm%%') AND"
    "                 (CONTAINS(Path, '%s'))"
    "           ORDER BY Rank"
    "    </QueryText>"
    "    </Context>"
    "    <Range><StartAt>1</StartAt><Count>100</Count></Range>"
    "    <ImplicitAndBehavior>true</ImplicitAndBehavior>"
    "    <EnableStemming>true</EnableStemming>"
    "    <TrimDuplicates>true</TrimDuplicates>"
    "    <IncludeSpecialTermResults>true</IncludeSpecialTermResults>"
    "    <IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery>"
    "    <IncludeRelevanceResults>true</IncludeRelevanceResults>"       
    "    <IncludeHighConfidenceResults>true</IncludeHighConfidenceResults>"
    "</Query>"
    "</QueryPacket>"

Any ideas/links/suggestions?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜