Answered Search WebService..

  • Thursday, April 19, 2012 7:30 AM
     
     

    ONE :
    i want to know, search webservice contains the following search..
    Exclude search using words parameters,
    or if i want to create a new search service to achive this..

    TWO:
    i write an query for search.. its working fine for to pick up  document names..
    but i want to pick up content in the files also
    Code:
                StringBuilder xmlString = new StringBuilder("<QueryPacket xmlns='urn:Microsoft.Search.Query'><Query><SupportedFormats><Format revision='1'> urn:Microsoft.Search.Response.Document:Document</Format></SupportedFormats><Context><QueryText language='en-US' type='MSSQLFT'>SELECT Author, Title, Path, Description, Created,Write, filename, Rank, Size, ContentSource, ContentType  FROM Scope() WHERE ");
                xmlString.Append(string.Format("\"Scope\" = '{0}' ", "ScopeName"));
                if (tbGet.Text.Length > 0)
                    xmlString.Append(string.Format(" and FREETEXT('{0}')", textbox.Text));           

                xmlString.Append(" order by rank desc");
                xmlString.Append("</QueryText></Context></Query></QueryPacket>");
                return xmlString.ToString();

    any sugesstion regarding content serach in files..

    Advance thanks...


    NS


    • Edited by NvzS Thursday, April 19, 2012 7:31 AM
    •  

All Replies

  • Wednesday, May 02, 2012 7:01 PM
     
     Answered

    Hi,

    If the correct IFilters are installed, then the text in your documents should also be searchable. You can do a quick test by searching via your SharePoint Search Center to check this.

    Without digging to deep into your query packet, I suggest switching from the SQL notation to the keyword query syntax (as the sql syntax is obsoleted).  Next download the query tool from http://fastforsharepoint.codeplex.com/ which will help you create query packets. It works equally well for the built-in search, so don't be alarmed by the "fast" part of the project name.

    Basically a query without specifying which field to search in will search the body content as well as any properties. Using the keyword query syntax you can exclude with terms by adding a - (minus) in front of it, like you would in the search box on your search center.

    Regards,
    Mikael Svenson


    Search Enthusiast - SharePoint MVP/WCF4/ASP.NET4
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint