-
Notifications
You must be signed in to change notification settings - Fork 11
/
schema.go
120 lines (113 loc) · 5.75 KB
/
schema.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
116
117
118
119
120
package solr
// Schema is a schema
type Schema struct {
Name string `json:"name"`
Version float64 `json:"version"`
UniqueKey string `json:"uniqueKey"`
FieldTypes []FieldType `json:"fieldTypes,omitempty"`
Fields []Field `json:"fields,omitempty"`
CopyFields []CopyField `json:"copyFields"`
}
// FieldType is a field type
type FieldType struct {
Name string `json:"name"`
Class string `json:"class,omitempty"`
PositionIncrementGap string `json:"positionIncrementGap,omitempty"`
AutoGeneratePhraseQueries string `json:"autoGeneratePhraseQueries,omitempty"`
SynonymQueryStyle string `json:"synonymQueryStyle,omitempty"`
EnableGraphQueries string `json:"enableGraphQueries,omitempty"`
DocValuesFormat string `json:"docValuesFormat,omitempty"`
PostingsFormat string `json:"postingsFormat,omitempty"`
Indexed bool `json:"indexed,omitempty"`
Stored bool `json:"stored,omitempty"`
DocValues bool `json:"docValues,omitempty"`
SortMissingFirst bool `json:"sortMissingFirst,omitempty"`
SortMissingLast bool `json:"sortMissingLast,omitempty"`
MultiValued bool `json:"multiValued,omitempty"`
Uninvertible bool `json:"uninvertible,omitempty"`
OmitNorms bool `json:"omitNorms,omitempty"`
OmitTermFreqAndPositions bool `json:"omitTermFreqAndPositions,omitempty"`
OmitPositions bool `json:"omitPositions,omitempty"`
TermVectors bool `json:"termVectors,omitempty"`
TermPositions bool `json:"termPositions,omitempty"`
TermOffsets bool `json:"termOffsets,omitempty"`
TermPayloads bool `json:"termPayloads,omitempty"`
Required bool `json:"required,omitempty"`
UseDocValuesAsStored bool `json:"useDocValuesAsStored,omitempty"`
Large bool `json:"large,omitempty"`
MaxCharsForDocValues string `json:"maxCharsForDocValues,omitempty"`
Geo string `json:"geo,omitempty"`
MaxDistErr string `json:"maxDistErr,omitempty"`
DistErrPct string `json:"distErrPct,omitempty"`
DistanceUnits string `json:"distanceUnits,omitempty"`
SubFieldSuffix string `json:"subFieldSuffix,omitempty"`
Dimension string `json:"dimension,omitempty"`
Analyzer *Analyzer `json:"analyzer,omitempty"`
IndexAnalyzer *Analyzer `json:"indexAnalyzer,omitempty"`
QueryAnalyzer *Analyzer `json:"queryAnalyzer,omitempty"`
}
// Tokenizer is a tokenizer
type Tokenizer struct {
Class string `json:"class"`
Delimeter string `json:"delimiter,omitempty"`
OutputUnknownUnigrams string `json:"outputUnknownUnigrams,omitempty"`
DecompoundMode string `json:"decompoundMode,omitempty"`
Mode string `json:"mode,omitempty"`
}
// Analyzer is an analyzer
type Analyzer struct {
Tokenizer *Tokenizer `json:"tokenizer"`
Filters []Filter `json:"filters,omitempty"`
CharFilters []Filter `json:"charFilters,omitempty"`
}
// Filter is a filter
type Filter struct {
Class string `json:"class"`
Encoder string `json:"encoder,omitempty"`
Inject string `json:"inject,omitempty"`
Words string `json:"words,omitempty"`
IgnoreCase string `json:"ignoreCase,omitempty"`
Articles string `json:"articles,omitempty"`
Language string `json:"language,omitempty"`
Format string `json:"format,omitempty"`
Protected string `json:"protected,omitempty"`
Expand string `json:"expand,omitempty"`
Synonyms string `json:"synonyms,omitempty"`
CatenateNumbers string `json:"catenateNumbers,omitempty"`
GenerateNumberParts string `json:"generateNumberParts,omitempty"`
SplitOnCaseChange string `json:"splitOnCaseChange,omitempty"`
GenerateWordParts string `json:"generateWordParts,omitempty"`
CatenateAll string `json:"catenateAll,omitempty"`
CatenateWords string `json:"catenateWords,omitempty"`
MaxPosQuestion string `json:"maxPosQuestion,omitempty"`
MaxFractionAsterisk string `json:"maxFractionAsterisk,omitempty"`
MaxPosAsterisk string `json:"maxPosAsterisk,omitempty"`
WithOriginal string `json:"withOriginal,omitempty"`
StemDerivational string `json:"stemDerivational,omitempty"`
MinimumLength string `json:"minimumLength,omitempty"`
Dictionary string `json:"dictionary,omitempty"`
Tags string `json:"tags,omitempty"`
Replacement string `json:"replacement,omitempty"`
Pattern string `json:"pattern,omitempty"`
PreserveOriginal string `json:"preserveOriginal,omitempty"`
Replace string `json:"replace,omitempty"`
MinGramSize int `json:"minGramSize,omitempty"`
MaxGramSize int `json:"maxGramSize,omitempty"`
}
// Field is a field
type Field struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
DocValues bool `json:"docValues,omitempty"`
Indexed bool `json:"indexed,omitempty"`
Stored bool `json:"stored,omitempty"`
MultiValued bool `json:"multiValued,omitempty"`
Required bool `json:"required,omitempty"`
UseDocValuesAsStored bool `json:"useDocValuesAsStored,omitempty"`
}
// CopyField is a copy field
type CopyField struct {
Source string `json:"source,omitempty"`
Dest string `json:"dest,omitempty"`
MaxChars int `json:"maxchars,omitempty"`
}