Search returns exception when using REST API.

I have a high trust app that is working perfectly making Search requests on behalf of logged in users through the REST api, until they use SharePoint as the queryterm.

https://servername/_api/search/query?querytext='SharePoint'&sourceid='8413cd39-2156-4e00-b54d-11efd9abdb89'

This throws an HTTP 500 error with the following entry in the ULS logs:-

ResultMapperException caught in SearchService.Execute method.   Exception: Microsoft.Office.Server.Search.REST.ResultMapperException: Two relevant result tables with same id.   

 at Microsoft.Office.Server.Search.REST.ResultMapper.MapRelevantResults(ResultTable table, QueryResult queryResult)   

 at Microsoft.Office.Server.Search.REST.ResultMapper.Map(ResultTableCollection result)   

 at Microsoft.Office.Server.Search.REST.SearchService.Execute[T](Action`1 initializer, Func`2 executor)

If you search for SharePoint through the UI it's fine, and if I specify a result source or not, it fails on this querytext.

I've only seen one other instance of this error mentioned on the net, and the queryterm was different, but the result the same.

August 25th, 2015 9:51am

Hi Paul,

Please add the query string "&enableinterleaving=false" at the end of the URL as a workaround, then test again.

e.g.

https://servername/_api/search/query?querytext='SharePoint'&enableinterleaving=false

https://servername/_api/search/query?querytext='SharePoint'&sourceid='8413cd39-2156-4e00-b54d-11efd9abdb89'&enableinterleaving=false

Thanks

Daniel

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 4:52am

Hi Daniel,

Yes that works nicely and resolves the HTTP 500 error.

Do you know if it makes any significant changes to the structure of the result response as the developers have already finished the result transformation code.

Paul.

August 26th, 2015 6:41am

Hi Paul,

Per the description to the property enableinterleaving, it is related that if the ResultTables in the ResultTableCollection produced by executing this query should be interleaved, it seems only impact results rank order like below article mentioned.

Please see more from below articles.

https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.search.query.query.enableinterleaving.aspx

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.search.query.query.enableinterleaving.aspx

http://www.sharepointnutsandbolts.com/2014/05/office-365-sharepoint-hybrid-combining-results.html

Thanks

Daniel

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 4:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics