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 am using the SPServices javascript library to make a search request to sharepoint 2010 search. I am trying this query:

queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>";
queryText += "<Query>";
queryText += "<Context>";
queryText += "<QueryText language='en-US' type='MSSQLFT'>";
queryText += "SELECT Title, Rank, Size, Description, Write, Path FROM portal..scope() WHERE CONTAINS ('test') ORDER BY \"Rank\" DESC";
queryText += "</QueryText>";
queryText += "</Context>";
queryText += "</Query>";
queryText += "</QueryPacket>";


alert(queryText);


$().SPServices({
    operation: "Query",
    queryXml: queryText,
    completefunc: searchComplete
});

The result of the query string looks like:

<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'><Query><Context><QueryText language='en-US' type='MSSQLFT'>SELECT Title, Rank, Size, Description, Write, Path FROM portal..scope() WHERE CONTAINS ('test') ORDER BY "Rank" DESC</QueryText></Context></Query></QueryPacket>

And the returned response is:

<ResponsePacket xmlns="urn:Microsoft.Search.Response"><Response domain=""><Status>ERROR_BAD_QUERY</Status><DebugErrorMessage>Your query is malformed. Please rephrase your query.</DebugErrorMessage></Response></ResponsePacket>

Does anyone know what is wrong?

Thanks.

share|improve this question

1 Answer 1

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.