Documentation
¶
Overview ¶
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.
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.
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.
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.
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.
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.
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.
Index ¶
- Constants
- Variables
- type CompositeField
- func (c *CompositeField) Analyze() (int, analysis.TokenFrequencies)
- func (c *CompositeField) ArrayPositions() []uint64
- func (c *CompositeField) Compose(field string, length int, freq analysis.TokenFrequencies)
- func (c *CompositeField) Name() string
- func (c *CompositeField) Options() IndexingOptions
- func (c *CompositeField) Value() []byte
- type DateTimeField
- func NewDateTimeField(name string, arrayPositions []uint64, dt time.Time) (*DateTimeField, error)
- func NewDateTimeFieldFromBytes(name string, arrayPositions []uint64, value []byte) *DateTimeField
- func NewDateTimeFieldWithIndexingOptions(name string, arrayPositions []uint64, dt time.Time, options IndexingOptions) (*DateTimeField, error)
- func (n *DateTimeField) Analyze() (int, analysis.TokenFrequencies)
- func (n *DateTimeField) ArrayPositions() []uint64
- func (n *DateTimeField) DateTime() (time.Time, error)
- func (n *DateTimeField) GoString() string
- func (n *DateTimeField) Name() string
- func (n *DateTimeField) Options() IndexingOptions
- func (n *DateTimeField) Value() []byte
- type Document
- type Field
- type IndexingOptions
- type NumericField
- func NewNumericField(name string, arrayPositions []uint64, number float64) *NumericField
- func NewNumericFieldFromBytes(name string, arrayPositions []uint64, value []byte) *NumericField
- func NewNumericFieldWithIndexingOptions(name string, arrayPositions []uint64, number float64, options IndexingOptions) *NumericField
- func (n *NumericField) Analyze() (int, analysis.TokenFrequencies)
- func (n *NumericField) ArrayPositions() []uint64
- func (n *NumericField) GoString() string
- func (n *NumericField) Name() string
- func (n *NumericField) Number() (float64, error)
- func (n *NumericField) Options() IndexingOptions
- func (n *NumericField) Value() []byte
- type TextField
- func NewTextField(name string, arrayPositions []uint64, value []byte) *TextField
- func NewTextFieldCustom(name string, arrayPositions []uint64, value []byte, options IndexingOptions, ...) *TextField
- func NewTextFieldWithAnalyzer(name string, arrayPositions []uint64, value []byte, ...) *TextField
- func NewTextFieldWithIndexingOptions(name string, arrayPositions []uint64, value []byte, options IndexingOptions) *TextField
Constants ¶
const DEFAULT_COMPOSITE_INDEXING_OPTIONS = INDEX_FIELD
const DEFAULT_DATETIME_INDEXING_OPTIONS = STORE_FIELD | INDEX_FIELD
const DEFAULT_DATETIME_PRECISION_STEP uint = 4
const DEFAULT_NUMERIC_INDEXING_OPTIONS = STORE_FIELD | INDEX_FIELD
const DEFAULT_PRECISION_STEP uint = 4
const DEFAULT_TEXT_INDEXING_OPTIONS = INDEX_FIELD
Variables ¶
var MaxTimeRepresentable = time.Unix(0, math.MaxInt64)
var MinTimeRepresentable = time.Unix(0, math.MinInt64)
Functions ¶
This section is empty.
Types ¶
type CompositeField ¶
type CompositeField struct {
// contains filtered or unexported fields
}
func NewCompositeField ¶
func NewCompositeField(name string, defaultInclude bool, include []string, exclude []string) *CompositeField
func NewCompositeFieldWithIndexingOptions ¶
func NewCompositeFieldWithIndexingOptions(name string, defaultInclude bool, include []string, exclude []string, options IndexingOptions) *CompositeField
func (*CompositeField) Analyze ¶
func (c *CompositeField) Analyze() (int, analysis.TokenFrequencies)
func (*CompositeField) ArrayPositions ¶
func (c *CompositeField) ArrayPositions() []uint64
func (*CompositeField) Compose ¶
func (c *CompositeField) Compose(field string, length int, freq analysis.TokenFrequencies)
func (*CompositeField) Name ¶
func (c *CompositeField) Name() string
func (*CompositeField) Options ¶
func (c *CompositeField) Options() IndexingOptions
func (*CompositeField) Value ¶
func (c *CompositeField) Value() []byte
type DateTimeField ¶
type DateTimeField struct {
// contains filtered or unexported fields
}
func NewDateTimeField ¶
func NewDateTimeFieldFromBytes ¶
func NewDateTimeFieldFromBytes(name string, arrayPositions []uint64, value []byte) *DateTimeField
func NewDateTimeFieldWithIndexingOptions ¶
func NewDateTimeFieldWithIndexingOptions(name string, arrayPositions []uint64, dt time.Time, options IndexingOptions) (*DateTimeField, error)
func (*DateTimeField) Analyze ¶
func (n *DateTimeField) Analyze() (int, analysis.TokenFrequencies)
func (*DateTimeField) ArrayPositions ¶
func (n *DateTimeField) ArrayPositions() []uint64
func (*DateTimeField) GoString ¶
func (n *DateTimeField) GoString() string
func (*DateTimeField) Name ¶
func (n *DateTimeField) Name() string
func (*DateTimeField) Options ¶
func (n *DateTimeField) Options() IndexingOptions
func (*DateTimeField) Value ¶
func (n *DateTimeField) Value() []byte
type Document ¶
type Document struct { ID string `json:"id"` Fields []Field `json:"fields"` CompositeFields []*CompositeField }
func NewDocument ¶
type Field ¶
type Field interface { Name() string ArrayPositions() []uint64 Options() IndexingOptions Analyze() (int, analysis.TokenFrequencies) Value() []byte }
type IndexingOptions ¶
type IndexingOptions int
const ( INDEX_FIELD IndexingOptions = 1 << iota STORE_FIELD INCLUDE_TERM_VECTORS )
func (IndexingOptions) IncludeTermVectors ¶
func (o IndexingOptions) IncludeTermVectors() bool
func (IndexingOptions) IsIndexed ¶
func (o IndexingOptions) IsIndexed() bool
func (IndexingOptions) IsStored ¶
func (o IndexingOptions) IsStored() bool
func (IndexingOptions) String ¶
func (o IndexingOptions) String() string
type NumericField ¶
type NumericField struct {
// contains filtered or unexported fields
}
func NewNumericField ¶
func NewNumericField(name string, arrayPositions []uint64, number float64) *NumericField
func NewNumericFieldFromBytes ¶
func NewNumericFieldFromBytes(name string, arrayPositions []uint64, value []byte) *NumericField
func NewNumericFieldWithIndexingOptions ¶
func NewNumericFieldWithIndexingOptions(name string, arrayPositions []uint64, number float64, options IndexingOptions) *NumericField
func (*NumericField) Analyze ¶
func (n *NumericField) Analyze() (int, analysis.TokenFrequencies)
func (*NumericField) ArrayPositions ¶
func (n *NumericField) ArrayPositions() []uint64
func (*NumericField) GoString ¶
func (n *NumericField) GoString() string
func (*NumericField) Name ¶
func (n *NumericField) Name() string
func (*NumericField) Number ¶
func (n *NumericField) Number() (float64, error)
func (*NumericField) Options ¶
func (n *NumericField) Options() IndexingOptions
func (*NumericField) Value ¶
func (n *NumericField) Value() []byte
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
func NewTextField ¶
func NewTextFieldCustom ¶
func NewTextFieldWithIndexingOptions ¶
func NewTextFieldWithIndexingOptions(name string, arrayPositions []uint64, value []byte, options IndexingOptions) *TextField
func (*TextField) ArrayPositions ¶
func (*TextField) Options ¶
func (t *TextField) Options() IndexingOptions