Imporve consistency of results from azure provider

The search feature does not produce consistent results across api
pages. This seems to be more likely if the pages are sorted by rank.

This changes the sort order, in order to make the pages a little bit
more consistent as the search index in azure changes.

Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
Brian Fletcher
2023-08-21 09:21:17 +01:00
parent b2ff304ddd
commit 94f9650849
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-azure': patch
---
Improve consistency of results from the `AzureDevOpsEntityProvider`.
@@ -64,6 +64,12 @@ export async function codeSearch(
method: 'POST',
body: JSON.stringify({
searchText: `path:${path} repo:${repo || '*'} proj:${project || '*'}`,
$orderBy: [
{
field: 'path',
sortOrder: 'ASC',
},
],
$skip: items.length,
$top: PAGE_SIZE,
}),