title: Exposing Sharepoint Metadata to web service search
body: <p>Our organization has started a project hoping to use sharepoint to create Electronic Records for Clients rather than the paper method which tends to have documents get lost etc.</p>
  
  <p>I have been tasked with interfacing with sharepoint to find documents associated with a given client.  Each document has sharepoint metadata that stores a ClientNumber, but I am having issues finding how to use the QueryService web service to search on this specific field.  There are about 30 document libraries I am to search through, so believe the QueryService is probably a better fit for this particular situation than ListService.</p>
  
  <p>I am using VB code to do the searching, and the following is the querytext I am sending to the QueryEx Function.</p>
  
  <p><code>...&lt;QueryText type='MSSQLFT'&gt;
  SELECT rank, title, path, Description, Write, Size, author, sitename, FileExtension, HitHighlightedSummary, HitHighlightedProperties, keywords, IsDocument from Scope() WHERE FREETEXT(DEFAULTPROPERTIES,'" &amp; Me.ClientNumber.Text &amp; "') AND IsDocument = 1 ORDER BY Rank DESC -- &lt;/QueryText&gt;...</code></p>
  
  <p>I would like to be able to include something in the WHERE clause that explicitly says a match must be found in the ClientNumber field but I have yet to find a way to do this, and as a result of this we are getting results where other metadata or one of the document properties such as document size is equal to the client number.</p>
  
  <p>I have found documentation that there is a way to expose metadata through property mappings and this then becomes searchable.  I however cannot find a way this is done in WSS 3.0, is this a MOSS 2007 only feature, or a feature available in 2010?</p>
  
  <p>If anyone can tell me if there is possibly some other way to search based on metadata, or give some insight as to where I should be looking for more information it would be greatly appreciated.</p>