Skip to main content
3 of 3
edited title
YogaPanda
  • 859
  • 7
  • 24

SharePoint2010 /_vti_bin/listdata.svc

I was trying to mimic a search site via listdata.svc due to the incapability of OOTB Search Result webpart.

Is there'a way to utilize KQL or any other way to allow users to search for a sentence?

Here's my code:

var webServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl;
$.ajax({
    url: webServerRelativeUrl + "/_vti_bin/listdata.svc/Pages?$filter=(Title eq 'keyword')",
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (response) {
        console.log(response.d.results[0].Title);
    },
    error: function (data) {
        console(JSON.stringify(response));
    }
});

However, users won't be able to get any results if they search for more than a word. Is there any syntax reference can help? Or there's a better way than "/_vti_bin/listdata.svc" ?

YogaPanda
  • 859
  • 7
  • 24