(front) Albums: Improve query
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="container">
|
||||
<h1>Albums</h1>
|
||||
<h1>Albums - {{this.albums.length}}</h1>
|
||||
|
||||
<div class="col-md-12">
|
||||
<table class="table table-striped" style="white-space: nowrap;">
|
||||
|
||||
@@ -35,12 +35,8 @@ export class AlbumsComponent implements OnInit {
|
||||
|
||||
// If firt edit, add needed fields in ELS Query
|
||||
if (!this.filterQuery['query']) {
|
||||
this.filterQuery['query'] = {
|
||||
'bool': {
|
||||
'must': [],
|
||||
'must_not': []
|
||||
}
|
||||
}
|
||||
this.filterQuery['query']['bool'][type].push({ 'must': [] })
|
||||
this.filterQuery['query']['bool'][type].push({ 'must_not': [] })
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,16 @@ import { ElsService } from './els.service';
|
||||
@Injectable()
|
||||
export class ElsAlbumService extends ElsService {
|
||||
public static readonly GET_ALBUMS_DEFAULT_QUERY = {
|
||||
'sort': [ {
|
||||
'Avg Bit Rate': {
|
||||
'order': 'asc'
|
||||
'query': {
|
||||
'bool': {
|
||||
'must': [],
|
||||
'must_not': [],
|
||||
'filter': [
|
||||
{ 'range': { 'Avg Bit Rate': { 'lte': '128'}}}
|
||||
]
|
||||
}
|
||||
}, {
|
||||
},
|
||||
'sort': [ {
|
||||
'_script' : {
|
||||
'type' : 'number',
|
||||
'script' : {
|
||||
@@ -23,8 +28,12 @@ export class ElsAlbumService extends ElsService {
|
||||
},
|
||||
'order' : 'desc'
|
||||
}
|
||||
}, {
|
||||
'Avg Bit Rate': {
|
||||
'order': 'asc'
|
||||
}
|
||||
} ],
|
||||
'size': ElsService.DEFAULT_SIZE
|
||||
'size': 500
|
||||
}
|
||||
|
||||
constructor(protected http: HttpClient) {
|
||||
|
||||
Reference in New Issue
Block a user