Skip to content

Commit

Permalink
Add secondary sorting based on publicationYear
Browse files Browse the repository at this point in the history
  • Loading branch information
ommann committed Jan 4, 2024
1 parent 6e71a2a commit 06564b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, inject, OnDestroy, Pipe, PipeTransform } from '@angular/core';
import { CdkTableModule, DataSource } from '@angular/cdk/table';
import { BehaviorSubject, combineLatest, merge, Observable } from 'rxjs';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { ActivatedRoute, Router, RouterLink, RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { AsyncPipe, JsonPipe, NgForOf, NgIf, NgStyle } from '@angular/common';
import {
Expand Down Expand Up @@ -37,6 +37,7 @@ import { FirstLetterPipe } from '@shared/pipes/first-letter.pipe';
imports: [CdkTableModule, FormsModule, AsyncPipe, JsonPipe, NgForOf, NgIf, LimitPipe, NgArrayPipesModule,
SharedModule, //TODO not good?
FormsModule,
RouterModule,
SearchBar2Component, OrganizationFilterComponent, FilterOptionComponent, CollapsibleComponent, MatButtonModule, NgStyle, FilterLimitButtonComponent, FirstDigitPipe, FirstLetterPipe, RouterLink
],
standalone: true
Expand Down
4 changes: 4 additions & 0 deletions src/app/portal/services/publication2.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export class Publication2Service {
from: from,
size: size,
track_total_hits: true,
sort: [
"_score",
{ "publicationYear": { "order": "desc" } }
],
query: {
bool: {
must: {
Expand Down

0 comments on commit 06564b7

Please sign in to comment.