Hi,
I got the webservice working.
But I'm having a very hard time to filter my search.
I want to for example get documents that belong to a certain document library and search on custom properties.
I can't figure out how to do it. I tried using the SQL query syntax but I only manage to retrieve the documents I want:
StringBuilder sb = new StringBuilder();
sb.Append("<QueryPacket xmlns='urn:Microsoft.Search.Query'><Query>");
sb.Append("<SupportedFormats><Format revision='1'>urn:Microsoft.Search.Response.Document:Document</Format>");
sb.Append("<Format revision='1'>urn:Microsoft.Search.Response.Content:Content</Format>");
//sb.Append("</SupportedFormats><Context><QueryText language='en-US' type='STRING'>new</QueryText></Context>");
sb.Append("</SupportedFormats><Context><QueryText type='MSSQLFT' language='en-us'>select path,title,size,write,\"urn:schemas-microsoft-com:office:office#ows_ListTemplate\", \"DAV:iscollection\",IsDocument, displaytitle, description, \"DAV:getcontenttype\", rank from scope() where size > 0 and freetext('" + _searchQuery + "') and IsDocument like '1'-- </QueryText></Context>");
sb.Append("<Range><StartAt>1</StartAt><Count>100</Count></Range>");
sb.Append("<Properties></Properties><SortByProperties><SortByProperty name='IsDocument' direction='Ascending'/></SortByProperties>");
sb.Append("</Query></QueryPacket>");
SPSSearch.QueryService qWSSsearch = new SPSSearch.QueryService();
qWSSsearch.Credentials = G4SCommon.GetCredentials();
This query works fine, but it returns to much information, I want to narrow the saerch to a certain document library and even to the contents of some custom fields.
If I trie to use these custom fileds I get an error. Has someone doen this before? Or does anyone has examples of complicated searches with WSS 3.0?
I got lots of code from SPS 2003, but it is not applicable anymore.