forked from geolba/tethys.frontend
Opensearch progress.
- Term search works - Pending faceted search - Ongoing: highlight of fuzzy results
This commit is contained in:
parent
6d1c1b28c3
commit
4f53411d07
5 changed files with 292 additions and 204 deletions
|
@ -1,27 +1,63 @@
|
|||
// import moment from "moment";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
// // SOLR Dataset original
|
||||
// export interface Dataset {
|
||||
// abstract_additional: Array<string>;// OpenSearch: abstract: Array<string>
|
||||
// abstract_output: string;// -----
|
||||
// author: Array<string>;// EQUAL
|
||||
// author_sort: Array<string>;// -----
|
||||
// belongs_to_bibliography: boolean;// EQUAL
|
||||
// creating_corporation: string;// EQUAL
|
||||
// doctype: string;// EQUAL
|
||||
// geo_location: string;// EQUAL
|
||||
// id: number;// EQUAL
|
||||
// identifier: Identifier;// OpenSearch: identifier: Array<string>
|
||||
// language: string;// EQUAL
|
||||
// licence: string;// EQUAL
|
||||
// publisher_name: string;// EQUAL
|
||||
// server_date_published: Array<number>;// OpenSearch not array!
|
||||
// subject: Array<string>;// OpenSearch: subjectS
|
||||
// title_output: string;// EQUAL
|
||||
// year: number;// EQUAL
|
||||
// year_inverted: number;// EQUAL
|
||||
// }
|
||||
|
||||
// OpenSearch Dataset
|
||||
export interface Dataset {
|
||||
abstract_additional: Array<string>;
|
||||
abstract_output: string;
|
||||
author: Array<string>;
|
||||
author_sort: Array<string>;
|
||||
belongs_to_bibliography: boolean;
|
||||
creating_corporation: string;
|
||||
doctype: string;
|
||||
geo_location: string;
|
||||
id: number;
|
||||
identifier: Identifier;
|
||||
language: string;
|
||||
licence: string;
|
||||
publisher_name: string;
|
||||
server_date_published: Array<number>;
|
||||
subject: Array<string>;
|
||||
title_output: string;
|
||||
year: number;
|
||||
year_inverted: number;
|
||||
abstract: Array<string>;// OpenSearch: abstract: Array<string>
|
||||
// abstract_output: string;// ----- NOT in OpenSearch
|
||||
author: Array<string>;// EQUAL
|
||||
// author_sort: Array<string>;// ----- NOT in OpenSearch
|
||||
belongs_to_bibliography: boolean;// EQUAL
|
||||
creating_corporation: string;// EQUAL
|
||||
doctype: string;// EQUAL
|
||||
geo_location: string;// EQUAL
|
||||
id: number;// EQUAL
|
||||
// identifier: Identifier;// OpenSearch: identifier: Array<string>
|
||||
identifier: Array<string>// DIFF DATATYPE
|
||||
language: string;// EQUAL
|
||||
licence: string;// EQUAL
|
||||
publisher_name: string;// EQUAL
|
||||
// server_date_published: Array<number>;// OpenSearch string!
|
||||
server_date_published: string;// DIFF DATATYPE
|
||||
// subject: Array<string>;// OpenSearch: subjectS
|
||||
subjects: Array<string>;// DIFF DATATYPE
|
||||
title_output: string;// EQUAL
|
||||
year: number;// EQUAL
|
||||
year_inverted: number;// EQUAL
|
||||
|
||||
title: string // Unique in OpenSearch
|
||||
title_additional: Array<string> // Unique in OpenSearch
|
||||
bbox_xmin: string // Unique in OpenSearch
|
||||
bbox_xmax: string // Unique in OpenSearch
|
||||
bbox_ymin: string // Unique in OpenSearch
|
||||
bbox_ymax: string // Unique in OpenSearch
|
||||
reference: Array<string> // Unique in OpenSearch
|
||||
abstract_additional: Array<string>;// Unique in OpenSearch
|
||||
}
|
||||
|
||||
|
||||
export class Suggestion {
|
||||
constructor(
|
||||
public value: string,
|
||||
|
@ -34,39 +70,10 @@ export class Suggestion {
|
|||
export enum SearchType {
|
||||
Title = "title",
|
||||
Author = "author",
|
||||
Subject = "subject",
|
||||
Subject = "subject"
|
||||
}
|
||||
|
||||
export class DbDataset {
|
||||
// public id!: number;
|
||||
// public url!: string;
|
||||
// public contributing_corporation!: string;
|
||||
// public creating_corporation!: string;
|
||||
// public publisher_name!: string;
|
||||
// public embargo_date!: string;
|
||||
// public publish_id!: number;
|
||||
// public project_id!: number;
|
||||
// public type!: string;
|
||||
// public language!: string;
|
||||
// public server_state!: string;
|
||||
// public belongs_to_bibliography!: boolean;
|
||||
// public created_at!: string;
|
||||
// public server_date_modified!: string;
|
||||
// public server_date_published!: string;
|
||||
// public account_id!: number;
|
||||
// public editor_id!: number;
|
||||
// public reviewer_id!: number;
|
||||
// public preferred_reviewer!: number;
|
||||
// public preferred_reviewer_email!: string;
|
||||
// public reject_editor_note!: string;
|
||||
// public reject_reviewer_note!: string;
|
||||
// public reviewer_note_visible!: string;
|
||||
// public titles!: Array<Title>;
|
||||
// public abstracts!: Array<Abstract>;
|
||||
// public authors!: Array<Author>;
|
||||
// public contributors!: Array<Author>;
|
||||
// public user!: Person;
|
||||
// public subjects!: Array<Subject>;
|
||||
|
||||
constructor(
|
||||
public id: string,
|
||||
|
|
|
@ -105,13 +105,29 @@ export interface Hit {
|
|||
_id: string;
|
||||
_score: number;
|
||||
_source: Dataset;
|
||||
_highlight: HitHighlight; // !! This name is to avoid collision with Typescript "Highlight" class
|
||||
}
|
||||
|
||||
export interface HitHighlight {
|
||||
subjects?: Array<string>;
|
||||
title?: Array<string>;
|
||||
author?: Array<string>;
|
||||
}
|
||||
|
||||
export interface Aggregations {
|
||||
[key: string]: Aggregation;
|
||||
subjects: Subjects;
|
||||
language: Language;
|
||||
}
|
||||
|
||||
export interface Aggregation {
|
||||
export interface Subjects {
|
||||
doc_count_error_upper_bound: number;
|
||||
sum_other_doc_count: number;
|
||||
buckets: Array<Bucket>;
|
||||
}
|
||||
|
||||
export interface Language {
|
||||
doc_count_error_upper_bound: number;
|
||||
sum_other_doc_count: number;
|
||||
buckets: Array<Bucket>;
|
||||
}
|
||||
|
||||
|
@ -119,3 +135,13 @@ export interface Bucket {
|
|||
key: string;
|
||||
doc_count: number;
|
||||
}
|
||||
// // Needed?
|
||||
// export interface Aggregations {
|
||||
// [key: string]: Aggregation;
|
||||
// }
|
||||
|
||||
// export interface Aggregation {
|
||||
// buckets: Array<Bucket>;
|
||||
// }
|
||||
|
||||
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue