0
0
Fork 0

doc: document field analyzer resolution

This commit is contained in:
Patrick Mezard 2015-10-02 17:00:45 +02:00
parent 498e4a0de7
commit ed1bdbf599
2 changed files with 13 additions and 4 deletions

View File

@ -127,7 +127,10 @@ func (b *Batch) Reset() {
// mapping is found and the root DocumentMapping is dynamic, default mappings
// are used based on value type and IndexMapping default configurations.
//
// Finally, mapped values are analyzed, indexed or stored. Examples:
// Finally, mapped values are analyzed, indexed or stored. See
// FieldMapping.Analyzer to know how an analyzer is resolved for a given field.
//
// Examples:
//
// type Date struct {
// Day string `json:"day"`

View File

@ -19,9 +19,15 @@ import (
// A FieldMapping describes how a specific item
// should be put into the index.
type FieldMapping struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Analyzer string `json:"analyzer,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
// Analyzer specifies the name of the analyzer to use for this field. If
// Analyzer is empty, traverse the DocumentMapping tree toward the root and
// pick the first non-empty DefaultAnalyzer found. If there is none, use
// the IndexMapping.DefaultAnalyzer.
Analyzer string `json:"analyzer,omitempty"`
Store bool `json:"store,omitempty"`
Index bool `json:"index,omitempty"`
IncludeTermVectors bool `json:"include_term_vectors,omitempty"`