0

Our product uses SP 365 search api. Several of our customers report that when using the following search API: '/_api/search/postquery' with body:

    {'request': {
         'Querytext':'test',
         'SourceId':'8413cd39-2156-4e00-b54d-11efd9abdb89', 
         'RowLimit':400,
         'SelectProperties':{
           'results':['Title','Path','Description','Write','Rank','Size']}, 
        'TrimDuplicates':true,
        'ClientType':'Custom',
        'Culture':1030,
        'SortList':{'results':[{'Property':'Rank','Direction':'1'}]}
     }}

returns HTTP status code 500 with error text (inside json response): 'An unknown error occurred.' However, if one adds to the query above a condition to limit it to a specific SP list, such as:

     {'request': {
         'Querytext':'test AND "ListId":{A7B96B28-6062-435B-A2EE-4792512A95A1}',
         'SourceId':'8413cd39-2156-4e00-b54d-11efd9abdb89', 
         'RowLimit':400,
         'SelectProperties':{
           'results':['Title','Path','Description','Write','Rank','Size']}, 
        'TrimDuplicates':true,
        'ClientType':'Custom',
        'Culture':1030,
        'SortList':{'results':[{'Property':'Rank','Direction':'1'}]}
     }}

then the query works well.

This happens for specific tenants like 'pfgroupas.sharepoint.com'. This API calls have been working for years now (started with SP 2013) & are broken in the last few days.

1 Answers1

0

Turns out that, for certain tenants, the internal server error manifests itself if you specify the 'SortList' parameter. If you create a query without it, like:

{'request': {
     'Querytext':'test',
     'SourceId':'8413cd39-2156-4e00-b54d-11efd9abdb89', 
     'RowLimit':400,
     'SelectProperties':{
       'results':['Title','Path','Description','Write','Rank','Size']}, 
    'TrimDuplicates':true,
    'ClientType':'Custom',
    'Culture':1030
 }}

then everything works fine. Seems to me like a server side bug.