Page view counter

search wss subsite

Last post 02-11-2009 6:13 AM by BlowTouch. 1 replies.

Sort Posts:

  • search wss subsite

    06-23-2008, 11:06 AM
    • Loading...
    • joel23
    • Joined on 06-23-2008, 3:04 PM
    • Posts 1
    • Points 0

    hi all
    I am using wss 3.0.
    i using the following code to search site contacts. but unfortunately i nether find the site nor contact.

    the main site is "http://wssdev".
    and the subsite that i want to search is "http://wssdev/bate".

    the code:

    try
    {
    DataTable resultsDataTable = new DataTable();

    SPSite site = new SPSite("http://wssdev/bate");
    {

    Microsoft.SharePoint.Search.Query.Query query =
    new Microsoft.SharePoint.Search.Query.FullTextSqlQuery (site);

    query.ResultTypes = ResultType.RelevantResults;
    query.QueryText = @"SELECT SiteName, FirstName FROM SCOPE()";
    ResultTableCollection resultTables = query.Execute();

    but in the site column i find just the "http://wssdev" site but not "http://wssdev/bate". and in the FirstName Field I don't find any of the "http://wssdev/bate" Contacs.

    Does any body have an idea!!
    Do I need to configure anything?

    thanks in advance
  • Re: search wss subsite

    02-11-2009, 6:13 AM
    • Loading...
    • BlowTouch
    • Joined on 10-23-2006, 9:46 AM
    • Posts 3
    • Points 12

    Have you been able to resolve this? 

    try the following:

    query.QueryText = "SELECT SiteName, FirstName FROM Scope() WHERE Contains(URL,'" + Page.Request.Url.GetLeftPart(UriPartial.Authority) + "')";

Page 1 of 1 (2 items)