2017-01-25 03:43:02 +01:00
|
|
|
// Copyright (c) 2014 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 document
|
|
|
|
|
|
|
|
import (
|
2021-01-18 02:21:14 +01:00
|
|
|
index "github.com/blevesearch/bleve_index_api"
|
2017-01-25 03:43:02 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type Field interface {
|
|
|
|
// Name returns the path of the field from the root DocumentMapping.
|
|
|
|
// A root field path is "field", a subdocument field is "parent.field".
|
|
|
|
Name() string
|
|
|
|
// ArrayPositions returns the intermediate document and field indices
|
|
|
|
// required to resolve the field value in the document. For example, if the
|
|
|
|
// field path is "doc1.doc2.field" where doc1 and doc2 are slices or
|
|
|
|
// arrays, ArrayPositions returns 2 indices used to resolve "doc2" value in
|
|
|
|
// "doc1", then "field" in "doc2".
|
|
|
|
ArrayPositions() []uint64
|
2021-01-18 02:21:14 +01:00
|
|
|
Options() index.FieldIndexingOptions
|
|
|
|
Analyze()
|
2017-01-25 03:43:02 +01:00
|
|
|
Value() []byte
|
|
|
|
|
|
|
|
// NumPlainTextBytes should return the number of plain text bytes
|
|
|
|
// that this field represents - this is a common metric for tracking
|
|
|
|
// the rate of indexing
|
|
|
|
NumPlainTextBytes() uint64
|
2019-02-18 01:50:26 +01:00
|
|
|
|
|
|
|
Size() int
|
2021-01-18 02:21:14 +01:00
|
|
|
|
|
|
|
EncodedFieldType() byte
|
|
|
|
AnalyzedLength() int
|
|
|
|
AnalyzedTokenFrequencies() index.TokenFrequencies
|
2017-01-25 03:43:02 +01:00
|
|
|
}
|