1

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.

1 Answer 1

1

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"'))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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