1

Using SPServices to make search requests, I am building the query like this:

var queryText;
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, Filename FROM Scope() WHERE CONTAINS ('" + text + "') AND ((\"SCOPE\" = '" + scope + "')) ORDER BY \"Rank\" DESC";
queryText += "</QueryText>";
queryText += "</Context>";
queryText += "<Range><Count>1000</Count></Range>";
queryText += "</Query>";
queryText += "</QueryPacket>";

How can I include the property which gives me the document ID?

1 Answer 1

0

Change the querytext to:

queryText += "SELECT Title, Rank, Size, Description, Write, Path, Filename, spdocid FROM Scope() WHERE CONTAINS ('" + text + "') AND ((\"SCOPE\" = '" + scope + "')) ORDER BY \"Rank\" DESC";
2
  • I got this <ResponsePacket xmlns="urn:Microsoft.Search.Response"><Response domain=""><Status>ERROR_SERVER</Status><DebugErrorMessage>Microsoft.Office.Server.Search.Query.InvalidPropertyException</DebugErrorMessage></Response></ResponsePacket> when adding spdocid.
    – omega
    Commented Jun 26, 2013 at 13:12
  • Please check if there is a Managed Property with that name in your environment. Commented Jun 26, 2013 at 15:45

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.