1

In my scenario i have programmatically created site collections by csom. Everything works fine right now. My problem is i want to manage search schema from one root site.

I have customized search with search rest api. For refiners i mapped desired crawled properties to for example RefinableString00 and everythings ok. But RefinableString00 is different for all site collections all of them empty except root because i edited it. So code cannot refine results from one root managed property. it looks for RefinableString00 where result found. Not for root RefinableString00. At this point i cannot manage refiners from root. My working code is below. I am stuck.

    var searchData = {
        'request': {
            '__metadata': {'type': 'Microsoft.Office.Server.Search.REST.SearchRequest'},
'Querytext': searchText,
'Refiners': 'RefinableString00',
'RefinementFilters': {'results': ['RefinableString00:("'+ searchText +'")']}
}
    };

var headers = {
            "accept": "application/json;odata=verbose",
            "content-type": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val()
        };


$.ajax({
            url: rootSiteURL + '/_api/search/postquery',
            method: "POST",
            data: JSON.stringify(searchData),               
            headers: headers ,
            async: true              
        }).done(function (data) {
            _successFunc(data);
        });

Your Answer

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

Browse other questions tagged or ask your own question.