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 {
2020 Properties map [string ]interface {}
2121}
2222
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+
2353// NewDocument creates a document with the specific id and score
2454func NewDocument (id string , score float32 ) Document {
2555 return Document {
Original file line number Diff line number Diff line change @@ -74,35 +74,6 @@ type SummaryOptions struct {
7474 Separator string // default "..."
7575}
7676
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-
10677// Query is a single search query and all its parameters and predicates
10778type Query struct {
10879 Raw string
You can’t perform that action at this time.
0 commit comments