Skip to content

Commit

Permalink
remove elastic random score attribute from projects and persons sections
Browse files Browse the repository at this point in the history
  • Loading branch information
konolak committed Nov 27, 2024
1 parent efa71da commit 5c9ff1c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/portal/services/filters/filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,17 @@ export class FilterService {
// If publications are searched without a search term then set sort as publicationYear
if (tab === 'publications') {
sortOrder.push({publicationYear: {order:'desc'}});
} else if (tab !== 'persons' && tab !== 'projects') {
sortOrder.push('_score');
}
} else {
// Search term or sort is used
if (tab === 'publications') {
sortOrder.push('_score');
sortOrder.push({publicationYear: {order:'desc'}});
} else if (tab !== 'persons' && tab !== 'projects') {
sortOrder.push('_score');
}
}

const queryPayload = searchTerm.length > 0 ? query : randomQuery;
Expand Down

0 comments on commit 5c9ff1c

Please sign in to comment.