-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
115 lines (98 loc) · 4.15 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package es
import (
"gopkg.in/olivere/elastic.v6"
"github.com/Bnei-Baruch/archive-backend/utils"
)
type EffectiveDate struct {
EffectiveDate *utils.Date `json:"effective_date"`
}
type ResultType struct {
ResultType string `json:"result_type"`
}
// For full description see make.py RESULTS TEMPLATE.
type Result struct {
// Document type.
ResultType string `json:"result_type"`
MDB_UID string `json:"mdb_uid"`
TypedUids []string `json:"typed_uids"`
FilterValues []string `json:"filter_values"`
// Result content fields.
Title string `json:"title"`
Description string `json:"description,omitempty"`
Content string `json:"content,omitempty"`
EffectiveDate *utils.Date `json:"effective_date,omitempty"`
// Suggest field for autocomplete.
TitleSuggest []string `json:"title_suggest"`
}
type ClassificationIntent struct {
// Fields from result.
ResultType string `json:"result_type"`
MDB_UID string `json:"mdb_uid"`
Title string `json:"title"`
// Intent fields.
ContentType string `json:"content_type"`
Exist bool `json:"exist"`
Score *float64 `json:"score,omitempty"`
Explanation elastic.SearchExplanation `json:"explanation,omitempty"`
MaxScore *float64 `json:"max_score,omitempty"`
MaxExplanation elastic.SearchExplanation `json:"max_explanation,omitempty"`
}
type Collection struct {
MDB_UID string `json:"mdb_uid"`
TypedUIDs []string `json:"typed_uids"`
Name string `json:"name"`
Description string `json:"description"`
ContentType string `json:"content_type"`
ContentUnitsContentTypes []string `json:"content_units_content_types,omitempty"`
EffectiveDate *utils.Date `json:"effective_date"`
OriginalLanguage string `json:"original_language,omitempty"`
}
type ContentUnit struct {
MDB_UID string `json:"mdb_uid"`
TypedUIDs []string `json:"typed_uids"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
ContentType string `json:"content_type"`
CollectionsContentTypes []string `json:"collections_content_types,omitempty"`
EffectiveDate *utils.Date `json:"effective_date,omitempty"`
Duration uint64 `json:"duration,omitempty"`
OriginalLanguage string `json:"original_language,omitempty"`
Translations []string `json:"translations,omitempty"`
Tags []string `json:"tags,omitempty"`
Sources []string `json:"sources,omitempty"`
Authors []string `json:"authors,omitempty"`
Persons []string `json:"persons,omitempty"`
Transcript string `json:"transcript,omitempty"`
}
type File struct {
MDB_UID string `json:"mdb_uid"`
Name string `json:"name"`
Size uint64 `json:"size"`
URL string `json:"url"`
Secure int `json:"secure"`
FilmDate *utils.Date `json:"film_date"`
Duration float64 `json:"duration,omitempty"`
Language string `json:"language,omitempty"`
MimeType string `json:"mimetype,omitempty"`
Type string `json:"type,omitempty"`
SubType string `json:"subtype,omitempty"`
}
type Classification struct {
MDB_UID string `json:"mdb_uid"`
Name string `json:"name,omitempty"`
NameSuggest string `json:"name_suggest,omitempty"`
Description string `json:"description,omitempty"`
DescriptionSuggest string `json:"description_suggest,omitempty"`
Type string `json:"classification_type"`
}
type Source struct {
MDB_UID string `json:"mdb_uid"`
Name string `json:"name"`
// Deprecated fields (since we use 'Result Template' in order to index the sources):
Description string `json:"description"`
Content string `json:"content"`
Sources []string `json:"sources"`
Authors []string `json:"authors"`
PathNames []string `json:"path_names"`
FullName []string `json:"full_name"`
}