Skip to content

Commit

Permalink
fix(api-headless-cms-ddb-es): use id as tie breaker
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric authored and Pavel910 committed Sep 18, 2024
1 parent 1c2ae12 commit 615413f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/api-elasticsearch/src/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const createSort = (params: CreateSortParams): SortType => {
* If we do not have id in the sort, we add it as we need a tie_breaker for the Elasticsearch to be able to sort consistently.
*/
if (!result["id.keyword"] && !result["id"]) {
result["_shard_doc"] = {
result["id.keyword"] = {
order: "asc"
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const createElasticsearchSort = (params: Params): esSort => {
if (!sort || sort.length === 0) {
return [
{
["_shard_doc"]: {
["id.keyword"]: {
order: "asc"
}
}
Expand Down

0 comments on commit 615413f

Please sign in to comment.