File tree Expand file tree Collapse file tree 2 files changed +30
-29
lines changed Expand file tree Collapse file tree 2 files changed +30
-29
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,36 @@ type Document struct {
20
20
Properties map [string ]interface {}
21
21
}
22
22
23
+
24
+ // IndexingOptions represent the options for indexing a single document
25
+ type IndexingOptions struct {
26
+
27
+ // If set, we use a stemmer for the supplied language during indexing. If set to "", we Default to English.
28
+ Language string
29
+
30
+ // If set to true, we will not save the actual document in the database and only index it.
31
+ NoSave bool
32
+
33
+ // If set, we will do an UPSERT style insertion - and delete an older version of the document if it exists.
34
+ Replace bool
35
+
36
+ // (only applicable with Replace): If set, you do not have to specify all fields for reindexing.
37
+ Partial bool
38
+
39
+ // Applicable only in conjunction with Replace and optionally Partial
40
+ // Update the document only if a boolean expression applies to the document before the update
41
+ ReplaceCondition string
42
+ }
43
+
44
+ // DefaultIndexingOptions are the default options for document indexing
45
+ var DefaultIndexingOptions = IndexingOptions {
46
+ Language : "" ,
47
+ NoSave : false ,
48
+ Replace : false ,
49
+ Partial : false ,
50
+ ReplaceCondition : "" ,
51
+ }
52
+
23
53
// NewDocument creates a document with the specific id and score
24
54
func NewDocument (id string , score float32 ) Document {
25
55
return Document {
Original file line number Diff line number Diff line change @@ -74,35 +74,6 @@ type SummaryOptions struct {
74
74
Separator string // default "..."
75
75
}
76
76
77
- // IndexingOptions represent the options for indexing a single document
78
- type IndexingOptions struct {
79
-
80
- // If set, we use a stemmer for the supplied language during indexing. If set to "", we Default to English.
81
- Language string
82
-
83
- // If set to true, we will not save the actual document in the database and only index it.
84
- NoSave bool
85
-
86
- // If set, we will do an UPSERT style insertion - and delete an older version of the document if it exists.
87
- Replace bool
88
-
89
- // (only applicable with Replace): If set, you do not have to specify all fields for reindexing.
90
- Partial bool
91
-
92
- // Applicable only in conjunction with Replace and optionally Partial
93
- // Update the document only if a boolean expression applies to the document before the update
94
- ReplaceCondition string
95
- }
96
-
97
- // DefaultIndexingOptions are the default options for document indexing
98
- var DefaultIndexingOptions = IndexingOptions {
99
- Language : "" ,
100
- NoSave : false ,
101
- Replace : false ,
102
- Partial : false ,
103
- ReplaceCondition : "" ,
104
- }
105
-
106
77
// Query is a single search query and all its parameters and predicates
107
78
type Query struct {
108
79
Raw string
You can’t perform that action at this time.
0 commit comments