SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have a library, mylibrary, that I want to search in using the search web service. How would I do that? So far I have tried this MSSQLFT query:

SELECT Title, Description, Path, Rank
WHERE FREETEXT(defaultproperties, 'test')
  AND "PATH" LIKE '%mylibrary%'
  AND "SCOPE" = 'All Sites'

If I run this query, I get no results. If I remove the PATH condition I get a result with a path like:


This makes no sense to me. Is there something I'm doing wrong, or is it just not supposed to work this way? How should I do this?

share|improve this question
up vote 2 down vote accepted

If you're using SharePoint 2010 then you shouldn't use the SQL syntax the keyword syntax is simple just use

site:mylibrary test

share|improve this answer
So you're saying I should just use <QueryText type="STRING">? That doesn't seem to work, I don't get any results. I have tried both on the SharePoint site and through the API. – Felix Mar 28 '12 at 9:11
First test your query string on the search page. Then just user type="STRING" – Per Jakobsen Mar 28 '12 at 9:20
Well, I tried your suggestion, site:mylibrary test, and I got not results. – Felix Mar 28 '12 at 9:52
Are you using just mylibrary or the full URL to mylibrary? It should be the latter, so in your case the query should be "site:sharepoint/mylibrary test" – Per Jakobsen Mar 28 '12 at 9:58
That worked. Thanks! – Felix Mar 28 '12 at 10:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.