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?

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";
  • 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 Jun 26 '13 at 13:12
  • Please check if there is a Managed Property with that name in your environment. – Max Melcher Jun 26 '13 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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