Merge pull request #243 from pmezard/document-fields-retrieval
doc: document field values storage and retrieval
This commit is contained in:
commit
c0335e9fe4
|
@ -28,6 +28,8 @@ type FieldMapping struct {
|
|||
// the IndexMapping.DefaultAnalyzer.
|
||||
Analyzer string `json:"analyzer,omitempty"`
|
||||
|
||||
// Store indicates whether to store field values in the index. Stored
|
||||
// values can be retrieved from search results using SearchRequest.Fields.
|
||||
Store bool `json:"store,omitempty"`
|
||||
Index bool `json:"index,omitempty"`
|
||||
IncludeTermVectors bool `json:"include_term_vectors,omitempty"`
|
||||
|
|
|
@ -152,7 +152,8 @@ func (h *HighlightRequest) AddField(field string) {
|
|||
// Highlight describes optional search result
|
||||
// highlighting.
|
||||
// Fields describes a list of field values which
|
||||
// should be retrieved for result documents.
|
||||
// should be retrieved for result documents, provided they
|
||||
// were stored while indexing.
|
||||
// Facets describe the set of facets to be computed.
|
||||
// Explain triggers inclusion of additional search
|
||||
// result score explanations.
|
||||
|
|
|
@ -37,12 +37,16 @@ type FieldTermLocationMap map[string]TermLocationMap
|
|||
type FieldFragmentMap map[string][]string
|
||||
|
||||
type DocumentMatch struct {
|
||||
ID string `json:"id"`
|
||||
Score float64 `json:"score"`
|
||||
Expl *Explanation `json:"explanation,omitempty"`
|
||||
Locations FieldTermLocationMap `json:"locations,omitempty"`
|
||||
Fragments FieldFragmentMap `json:"fragments,omitempty"`
|
||||
Fields map[string]interface{} `json:"fields,omitempty"`
|
||||
ID string `json:"id"`
|
||||
Score float64 `json:"score"`
|
||||
Expl *Explanation `json:"explanation,omitempty"`
|
||||
Locations FieldTermLocationMap `json:"locations,omitempty"`
|
||||
Fragments FieldFragmentMap `json:"fragments,omitempty"`
|
||||
|
||||
// Fields contains the values for document fields listed in
|
||||
// SearchRequest.Fields. Text fields are returned as strings, numeric
|
||||
// fields as float64s and date fields as time.RFC3339 formatted strings.
|
||||
Fields map[string]interface{} `json:"fields,omitempty"`
|
||||
}
|
||||
|
||||
func (dm *DocumentMatch) AddFieldValue(name string, value interface{}) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user