Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.