mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-11 11:55:38 +00:00
updated elastic autocomplete to include persons, also adds debounce & clearer handling of response
This commit is contained in:
@@ -13,6 +13,7 @@ export interface IAutocompleteSearchResults {
|
||||
timed_out: boolean;
|
||||
_shards: Shards;
|
||||
hits: Hits;
|
||||
suggest: Suggest;
|
||||
}
|
||||
|
||||
export interface Shards {
|
||||
@@ -37,6 +38,27 @@ export interface Hit {
|
||||
sort: number[];
|
||||
}
|
||||
|
||||
export interface Suggest {
|
||||
"movie-suggest": SuggestOptions[];
|
||||
"person-suggest": SuggestOptions[];
|
||||
"show-suggest": SuggestOptions[];
|
||||
}
|
||||
|
||||
export interface SuggestOptions {
|
||||
text: string;
|
||||
offset: number;
|
||||
length: number;
|
||||
options: Option[];
|
||||
}
|
||||
|
||||
export interface Option {
|
||||
text: string;
|
||||
_index: string;
|
||||
_id: string;
|
||||
_score: number;
|
||||
_source: Source;
|
||||
}
|
||||
|
||||
export enum Index {
|
||||
Movies = "movies",
|
||||
Shows = "shows"
|
||||
@@ -57,6 +79,8 @@ export interface Source {
|
||||
agent: Agent;
|
||||
original_title: string;
|
||||
original_name?: string;
|
||||
name?: string;
|
||||
type?: MediaTypes;
|
||||
}
|
||||
|
||||
export interface Agent {
|
||||
|
||||
Reference in New Issue
Block a user