Documentation ¶
Overview ¶
*
Copyright 2012 Matthew Baird 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
- func DoCommand(method string, url string, data interface{}) ([]byte, error)
- func Pretty(pretty bool) string
- func Scan(scan int) string
- func Scroll(duration string) string
- func SetHosts(newhosts []string)
- type BaseResponse
- type Error
- type Explaination
- type Facets
- type Filter
- type Match
- type Query
- type Request
- type SearchRequest
- type Status
- type Term
- type Terms
Constants ¶
View Source
const ( Version = "0.0.1" DefaultProtocol = "http" DefaultDomain = "localhost" DefaultPort = "9200" // A decay duration of zero results in the default behaviour DefaultDecayDuration = 0 )
Variables ¶
View Source
var ( // Maintain these for backwards compatibility Protocol string = DefaultProtocol Domain string = DefaultDomain Port string = DefaultPort // Store a slice of hosts in a hostpool Hosts []string // To compute the weighting scores, we perform a weighted average of recent response times, // over the course of `DecayDuration`. DecayDuration may be set to 0 to use the default // value of 5 minutes. The EpsilonValueCalculator uses this to calculate a score // from the weighted average response time. DecayDuration time.Duration = time.Duration(DefaultDecayDuration * time.Second) )
Functions ¶
Types ¶
type BaseResponse ¶
type BaseResponse struct { Ok bool `json:"ok"` Index string `json:"_index,omitempty"` Type string `json:"_type,omitempty"` Id string `json:"_id,omitempty"` Source *json.RawMessage `json:"_source,omitempty"` // depends on the schema you've defined Version int `json:"_version,omitempty"` Found bool `json:"found,omitempty"` Exists bool `json:"exists,omitempty"` Created bool `json:"created,omitempty"` Matches []string `json:"matches,omitempty"` // percolate matches }
type Error ¶
type Explaination ¶
type Explaination struct { Value float32 `json:"value"` Description string `json:"description"` Details []Explaination `json:"details,omitempty"` }
type Match ¶
type Match struct { OK bool `json:"ok"` Matches []string `json:"matches"` Explaination Explaination `json:"explaination,omitempty"` }
type Request ¶
func ElasticSearchRequest ¶
func (*Request) SetBodyJson ¶
func (*Request) SetBodyString ¶
type SearchRequest ¶
Click to show internal directories.
Click to hide internal directories.