mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-03 03:28:03 -05:00
Bumps [github.com/blevesearch/bleve/v2](https://github.com/blevesearch/bleve) from 2.3.9 to 2.3.10. - [Release notes](https://github.com/blevesearch/bleve/releases) - [Commits](https://github.com/blevesearch/bleve/compare/v2.3.9...v2.3.10) --- updated-dependencies: - dependency-name: github.com/blevesearch/bleve/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
94 lines
2.1 KiB
Go
94 lines
2.1 KiB
Go
// Copyright (c) 2015 Couchbase, Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package index
|
|
|
|
import "time"
|
|
|
|
type Document interface {
|
|
ID() string
|
|
Size() int
|
|
|
|
VisitFields(visitor FieldVisitor)
|
|
VisitComposite(visitor CompositeFieldVisitor)
|
|
HasComposite() bool
|
|
|
|
NumPlainTextBytes() uint64
|
|
|
|
AddIDField()
|
|
|
|
StoredFieldsBytes() uint64
|
|
}
|
|
|
|
type FieldVisitor func(Field)
|
|
|
|
type Field interface {
|
|
Name() string
|
|
Value() []byte
|
|
ArrayPositions() []uint64
|
|
|
|
EncodedFieldType() byte
|
|
|
|
Analyze()
|
|
|
|
Options() FieldIndexingOptions
|
|
|
|
AnalyzedLength() int
|
|
AnalyzedTokenFrequencies() TokenFrequencies
|
|
|
|
NumPlainTextBytes() uint64
|
|
}
|
|
|
|
type CompositeFieldVisitor func(field CompositeField)
|
|
|
|
type CompositeField interface {
|
|
Field
|
|
|
|
Compose(field string, length int, freq TokenFrequencies)
|
|
}
|
|
|
|
type TextField interface {
|
|
Text() string
|
|
}
|
|
|
|
type NumericField interface {
|
|
Number() (float64, error)
|
|
}
|
|
|
|
type DateTimeField interface {
|
|
DateTime() (time.Time, string, error)
|
|
}
|
|
|
|
type BooleanField interface {
|
|
Boolean() (bool, error)
|
|
}
|
|
|
|
type GeoPointField interface {
|
|
Lon() (float64, error)
|
|
Lat() (float64, error)
|
|
}
|
|
|
|
type GeoShapeField interface {
|
|
GeoShape() (GeoJSON, error)
|
|
}
|
|
|
|
// TokenizableSpatialField is an optional interface for fields that
|
|
// supports pluggable custom hierarchial spatial token generation.
|
|
type TokenizableSpatialField interface {
|
|
// SetSpatialAnalyzerPlugin lets the index implementations to
|
|
// initialise relevant spatial analyzer plugins for the field
|
|
// to override the spatial token generations during the analysis phase.
|
|
SetSpatialAnalyzerPlugin(SpatialAnalyzerPlugin)
|
|
}
|