Skip to content

Commit 19f1f26

Browse files
authored
add hex to analyzer's properties (#414)
1 parent 6d0f689 commit 19f1f26

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/go-driver/tree/master) (N/A)
4+
- Add `hex` property to analyzer's properties
45

56
## [1.3.3](https://github.com/arangodb/go-driver/tree/v1.3.3) (2022-07-27)
67
- Fix `lastValue` field type

test/arangosearch_analyzers_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,32 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
282282
},
283283
},
284284
},
285+
{
286+
Name: "create-stopWords",
287+
MinVersion: newVersion("3.9"),
288+
Definition: driver.ArangoSearchAnalyzerDefinition{
289+
Name: "my-stopWords",
290+
Type: driver.ArangoSearchAnalyzerTypeStopwords,
291+
Properties: driver.ArangoSearchAnalyzerProperties{
292+
Hex: newBool(true),
293+
Stopwords: []string{
294+
"616e64",
295+
"746865",
296+
},
297+
},
298+
},
299+
ExpectedDefinition: &driver.ArangoSearchAnalyzerDefinition{
300+
Name: "my-stopWords",
301+
Type: driver.ArangoSearchAnalyzerTypeStopwords,
302+
Properties: driver.ArangoSearchAnalyzerProperties{
303+
Hex: newBool(true),
304+
Stopwords: []string{
305+
"616e64",
306+
"746865",
307+
},
308+
},
309+
},
310+
},
285311
}
286312

287313
for _, testCase := range testCases {

view_arangosearch.go

+5
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ type ArangoSearchAnalyzerProperties struct {
191191

192192
// Break used by Segmentation
193193
Break ArangoSearchBreakType `json:"break,omitempty"`
194+
195+
// Hex used by stopwords.
196+
// If false then each string in stopwords is used verbatim.
197+
// If true, then each string in stopwords needs to be hex-encoded.
198+
Hex *bool `json:"hex,omitempty"`
194199
}
195200

196201
// ArangoSearchAnalyzerGeoJSONType GeoJSON Type parameter.

0 commit comments

Comments
 (0)