Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

How to use REST with the search service?

$
0
0

Hi,

I am currently using SP2010 and spservices to make SOAP requests for search. I am doing this client sided using javascript/jquery . But now I want to use REST and still on client side. This is my SOAP version in javascript:

    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 FROM Scope() WHERE CONTAINS ('" + text.replace(/ /g, "+") + "') AND ((\"SCOPE\" = '" + scope + "')) ORDER BY \"Rank\" DESC";
    queryText += "</QueryText>";
    queryText += "</Context>";
    queryText += "<Range><Count>" + searchLimit + "</Count></Range>";

    queryText += "<TrimDuplicates>false</TrimDuplicates>";
    queryText += "<IgnoreAllNoiseQuery>false</IgnoreAllNoiseQuery>";
    queryText += "<IncludeSpecialTermResults>true</IncludeSpecialTermResults>";
    queryText += "<IncludeRelevantResults>true</IncludeRelevantResults>";
    queryText += "<IncludeHighConfidenceResults>true</IncludeHighConfidenceResults>";

    queryText += "</Query>";
    queryText += "</QueryPacket>";

Can anyone please show my how to do this same thing in REST?

Thanks.



Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>