SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

I'm trying to perform search on a single list using FullTextSqlQuery. I found example here, but given this query:

"SELECT Title,ContentType,Path FROM portal..scope() WHERE freetext('" + query + "') AND (CONTAINS(Path,'\"" + list.RootFolder.ServerRelativeUrl + "\"'))"

which for example could look like this:

SELECT Title,ContentType,Path FROM portal..scope() WHERE freetext('samochód') AND (CONTAINS(Path,'"/BW/Lists/Pytania Bazy Wiedzy"'))

but I'm getting unhandled exception on query execution:

Unhandled Exception: Microsoft.SharePoint.Search.Query.QueryMalformedException: Your query is malformed. Please rephrase your query.

This is my first contact with performing search programatically so I have no idea what might be wrong with this query. Any information and help will be appreciated.

share|improve this question
up vote 1 down vote accepted

I think the portal.. part isn't correct and try specifying a column for the freetext predicate like this:

SELECT Title,ContentType,Path FROM SCOPE() WHERE FREETEXT(DefaultProperties,'samochód') AND (CONTAINS(Path,'"/BW/Lists/Pytania Bazy Wiedzy"'))
share|improve this answer

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.