tethys.frontend/src/models/headers.ts
Arno Kaimbacher 315f845292 - add new tethys style
- use newest typescript version ^4.5.2
- new images for starting page
2021-11-19 16:11:26 +01:00

86 lines
1.8 KiB
TypeScript

import { Dataset } from "./dataset";
export interface SolrResponse {
responseHeader: ResponseHeader;
response: ResponseContent;
facets: FacetFields;
// facet_counts: FacetCount;
}
export interface ResponseHeader {
status: boolean;
QTime: number;
params: ResponseHeaderParams;
}
export interface ResponseHeaderParams {
defType: string;
rows?: number;
start?: number;
wt?: string;
// 0:'fl=id,licence,server_date_published,abstract_output,identifier,title_output,title_additional,author,subject,doctype'
// df:'title'
// facet:'on'
// indent:'on'
// json.facet.language:'{ type: "terms", field: "language" }'
// json.facet.subject:'{ type: "terms", field: "subject" }'
// q:'title:Geodaten - Blatt 49 Wels (1:50.000)'
// q.op:'and'
// rows:'10'
// start:'0'
// wt:'json'
}
export interface ResponseContent {
numFound: number;
start: number;
docs: Array<Dataset>;
}
// export interface FacetCount {
// facet_fields: FacetCategory<any>;
// }
// export class FacetCategory<T> {
// [key: string]: {
// values: T[];
// };
// }
export class FacetResults {
// language!: Array<FacetItem>;
// subject!: Array<FacetItem>;
[key: string]: Array<FacetItem>;
}
//#region solr response facets
export class FacetFields {
// count: number;
language!: FacetInstance;
subject!: FacetInstance;
// [key: string]: FacetInstance;
}
export interface FacetInstance {
[key: string]: Array<FacetItem>;
// buckets: Array<FacetItem>;
}
export class FacetItem {
val: string;
count: number;
category: string;
active: boolean;
constructor(value: string, count: number) {
this.val = value;
this.count = count;
this.active = false;
this.category = "";
}
}
//#endregion