|
1 | 1 | //
|
2 | 2 | // DISCLAIMER
|
3 | 3 | //
|
4 |
| -// Copyright 2018 ArangoDB GmbH, Cologne, Germany |
| 4 | +// Copyright 2018-2023 ArangoDB GmbH, Cologne, Germany |
5 | 5 | //
|
6 | 6 | // Licensed under the Apache License, Version 2.0 (the "License");
|
7 | 7 | // you may not use this file except in compliance with the License.
|
|
17 | 17 | //
|
18 | 18 | // Copyright holder is ArangoDB GmbH, Cologne, Germany
|
19 | 19 | //
|
20 |
| -// Author Ewout Prangsma |
21 |
| -// |
22 | 20 |
|
23 | 21 | package driver
|
24 | 22 |
|
@@ -63,6 +61,10 @@ const (
|
63 | 61 | ArangoSearchAnalyzerTypeStopwords ArangoSearchAnalyzerType = "stopwords"
|
64 | 62 | // ArangoSearchAnalyzerTypeGeoJSON an Analyzer capable of breaking up a GeoJSON object into a set of indexable tokens for further usage with ArangoSearch Geo functions.
|
65 | 63 | ArangoSearchAnalyzerTypeGeoJSON ArangoSearchAnalyzerType = "geojson"
|
| 64 | + // ArangoSearchAnalyzerTypeGeoS2 an Analyzer capable of index GeoJSON data with inverted indexes or Views similar |
| 65 | + // to the existing `geojson` Analyzer, but it internally uses a format for storing the geo-spatial data. |
| 66 | + // that is more efficient. |
| 67 | + ArangoSearchAnalyzerTypeGeoS2 ArangoSearchAnalyzerType = "geo_s2" |
66 | 68 | // ArangoSearchAnalyzerTypeGeoPoint an Analyzer capable of breaking up JSON object describing a coordinate into a set of indexable tokens for further usage with ArangoSearch Geo functions.
|
67 | 69 | ArangoSearchAnalyzerTypeGeoPoint ArangoSearchAnalyzerType = "geopoint"
|
68 | 70 | // ArangoSearchAnalyzerTypeSegmentation an Analyzer capable of breaking up the input text into tokens in a language-agnostic manner
|
@@ -133,6 +135,24 @@ type ArangoSearchEdgeNGram struct {
|
133 | 135 | PreserveOriginal *bool `json:"preserveOriginal,omitempty"`
|
134 | 136 | }
|
135 | 137 |
|
| 138 | +type ArangoSearchFormat string |
| 139 | + |
| 140 | +const ( |
| 141 | + // FormatLatLngDouble stores each latitude and longitude value as an 8-byte floating-point value (16 bytes per coordinate pair). |
| 142 | + // It is default value. |
| 143 | + FormatLatLngDouble ArangoSearchFormat = "latLngDouble" |
| 144 | + // FormatLatLngInt stores each latitude and longitude value as an 4-byte integer value (8 bytes per coordinate pair). |
| 145 | + // This is the most compact format but the precision is limited to approximately 1 to 10 centimeters. |
| 146 | + FormatLatLngInt ArangoSearchFormat = "latLngInt" |
| 147 | + // FormatS2Point store each longitude-latitude pair in the native format of Google S2 which is used for geo-spatial |
| 148 | + // calculations (24 bytes per coordinate pair). |
| 149 | + FormatS2Point ArangoSearchFormat = "s2Point" |
| 150 | +) |
| 151 | + |
| 152 | +func (a ArangoSearchFormat) New() *ArangoSearchFormat { |
| 153 | + return &a |
| 154 | +} |
| 155 | + |
136 | 156 | // ArangoSearchAnalyzerProperties specifies options for the analyzer. Which fields are required and
|
137 | 157 | // respected depends on the analyzer type.
|
138 | 158 | // more information can be found here: https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#analyzer-properties
|
@@ -223,6 +243,9 @@ type ArangoSearchAnalyzerProperties struct {
|
223 | 243 | // NumHashes used by Minhash
|
224 | 244 | // Size of min hash signature. Must be greater or equal to 1.
|
225 | 245 | NumHashes *uint64 `json:"numHashes,omitempty"`
|
| 246 | + |
| 247 | + // Format is the internal binary representation to use for storing the geo-spatial data in an index. |
| 248 | + Format *ArangoSearchFormat `json:"format,omitempty"` |
226 | 249 | }
|
227 | 250 |
|
228 | 251 | // ArangoSearchAnalyzerGeoJSONType GeoJSON Type parameter.
|
|
0 commit comments