0

I trying to use Sp2013 query rules base of search terms get specific page. I created a query rule then tried to receive it on my browser using GET request.

_api/search/query?querytext="blah"

I tried to the same thing with POST request and I don't get that result . My post query object look that this:

 let sq = {
                'request': {
                    '__metadata': { 'type': 'Microsoft.Office.Server.Search.REST.SearchRequest' },
                    'Querytext':searchText ',
                    'QueryTemplatePropertiesUrl': 'spfile://webroot/queryparametertemplate.xml',
                'SelectProperties': { ["SomeSelectProperties"]},
                    'Refiners':["someReiners"]
                    'StartRow': startRow,
                    'RowsPerPage': rowlimit,
                    'TrimDuplicates':isTrimDuplicate,
                    'CollapseSpecification':"Title",
                    'RankingModelId':rankModel,
                    'RowLimit' : 10,
                    'SourceId': "8413cd39-2156-4e00-b54d-11efd9abdb89",
                    'EnableSorting' : true,
                    'EnableQueryRules': true,
                    'SortList':
                    {
                        'results' : [
                            {
                                'Property':'Rank',
                                'Direction': '1'
                            }
                        ]
                    },

                }
            };

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.