plasticine

package module
v0.0.0-...-b5edabe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

README

plasticine

Build Status

Plasticine is an open source client of Elasticsearch , support Elasticsearch versions : 1.3,1.4

Installation

Get the code with go get github.com/starchou/plasticine.

Usage

See examples

Api Status

See api status

Version

0.1

License

Copyright 2014 star Chou, All Rights Reserved.

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.

Documentation

Overview

Copyright 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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 2015 star Chou, All Rights Reserved. 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

View Source
const (
	Version         = "0.1"
	DefaultProtocol = "http"
	DefaultDomain   = "localhost"
	DefaultPort     = "9200"
	// A decay duration of zero results in the default behaviour
	DefaultDecayDuration = 0
)

Variables

View Source
var (
	Debug = false
)

Functions

func Array

func Array(v ...interface{}) []interface{}

func Asc

func Asc(v string) *simplejson.Json

func Boost

func Boost(v interface{}) interface{}

func Command

func Command(v ...interface{}) *simplejson.Json

func Commands

func Commands(v ...*simplejson.Json) []byte

func Delete

func Delete(url string, hr hostpool.HostPoolResponse) *context

Delete returns *context DELETE method.

func Desc

func Desc(v string) *simplejson.Json

func Exclude

func Exclude(v ...string) *simplejson.Json

func From

func From(v int) *simplejson.Json
func Facets(v interface{}) *simplejson.Json {
	j := simplejson.New()
	j.Set("facets", v)
	return j
}

func FromTo

func FromTo(from, to int) *simplejson.Json

func Get

func Get(url string, hr hostpool.HostPoolResponse) *context

Get returns *context with GET method.

func Head(url string, hr hostpool.HostPoolResponse) *context

Head returns *context Head method.

func Include

func Include(v ...string) *simplejson.Json

func Limit

func Limit(v int) *simplejson.Json

func MatchAll

func MatchAll(v interface{}) *simplejson.Json

func Order

func Order(field, order string) *simplejson.Json

func Post

func Post(url string, hr hostpool.HostPoolResponse) *context

Post returns *context with POST method.

func Put

func Put(url string, hr hostpool.HostPoolResponse) *context

Put returns *context with PUT method.

func Query

func Query(v interface{}) *simplejson.Json

func Sort

func Sort(v ...interface{}) *simplejson.Json

func To

func To(v int) *simplejson.Json

func Type

func Type(v string) *simplejson.Json

Types

type AllocateCommand

type AllocateCommand struct {
	Json *simplejson.Json `json:"allocate"`
}

func Allocate

func Allocate() *AllocateCommand

func (*AllocateCommand) AllowPrimary

func (c *AllocateCommand) AllowPrimary(val bool) *AllocateCommand

func (*AllocateCommand) Index

func (c *AllocateCommand) Index(val string) *AllocateCommand

func (*AllocateCommand) Node

func (c *AllocateCommand) Node(val string) *AllocateCommand

func (*AllocateCommand) Shard

func (c *AllocateCommand) Shard(val int) *AllocateCommand

type AndFilter

type AndFilter struct {
	Json *simplejson.Json `json:"and"`
}

func And

func And() *AndFilter

func (*AndFilter) And

func (j *AndFilter) And(v ...interface{}) interface{}

func (*AndFilter) Cache

func (j *AndFilter) Cache(v bool) *AndFilter

func (*AndFilter) Filters

func (j *AndFilter) Filters(v ...interface{}) *AndFilter

type AvgAggregation

type AvgAggregation struct {
	Json *simplejson.Json `json:"avg"`
	// contains filtered or unexported fields
}

func (*AvgAggregation) Aggs

func (j *AvgAggregation) Aggs() *SearchAggregation

func (*AvgAggregation) Field

func (j *AvgAggregation) Field(field string) *AvgAggregation

func (*AvgAggregation) Params

func (j *AvgAggregation) Params(k string, v interface{}) *AvgAggregation

func (*AvgAggregation) Script

func (j *AvgAggregation) Script(v string) *AvgAggregation

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 BooleanQuery

type BooleanQuery struct {
	Json *simplejson.Json `json:"bool"`
}

func Bool

func Bool() *BooleanQuery

func (*BooleanQuery) Boost

func (j *BooleanQuery) Boost(v float64) *BooleanQuery

float64

func (*BooleanQuery) Encode

func (j *BooleanQuery) Encode() []byte

func (*BooleanQuery) MinimumShouldMatch

func (j *BooleanQuery) MinimumShouldMatch(v interface{}) *BooleanQuery

func (*BooleanQuery) Must

func (j *BooleanQuery) Must(v ...interface{}) *BooleanQuery

func (*BooleanQuery) MustNot

func (j *BooleanQuery) MustNot(v ...interface{}) *BooleanQuery

func (*BooleanQuery) Should

func (j *BooleanQuery) Should(v ...interface{}) *BooleanQuery

type BoostingQuery

type BoostingQuery struct {
	Json *simplejson.Json `json:"boosting"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html

func Boosting

func Boosting() *BoostingQuery

func (*BoostingQuery) Boost

func (j *BoostingQuery) Boost(v float64) *BoostingQuery

func (*BoostingQuery) Encode

func (j *BoostingQuery) Encode() []byte

func (*BoostingQuery) Negative

func (j *BoostingQuery) Negative(v interface{}) *BoostingQuery

func (*BoostingQuery) Positive

func (j *BoostingQuery) Positive(v interface{}) *BoostingQuery

type CancelCommand

type CancelCommand struct {
	Json *simplejson.Json `json:"cancel"`
}

func Cancel

func Cancel() *CancelCommand

func (*CancelCommand) AllowPrimary

func (c *CancelCommand) AllowPrimary(val bool) *CancelCommand

func (*CancelCommand) Index

func (c *CancelCommand) Index(val string) *CancelCommand

func (*CancelCommand) Node

func (c *CancelCommand) Node(val string) *CancelCommand

func (*CancelCommand) Shard

func (c *CancelCommand) Shard(val int) *CancelCommand

type CardinalityAggregation

type CardinalityAggregation struct {
	Json *simplejson.Json `json:"cardinality"`
	// contains filtered or unexported fields
}

func (*CardinalityAggregation) Aggs

func (*CardinalityAggregation) Field

func (*CardinalityAggregation) PrecisionThreshold

func (j *CardinalityAggregation) PrecisionThreshold(v int) *CardinalityAggregation

func (*CardinalityAggregation) Rehash

func (*CardinalityAggregation) Script

type CatApi

type CatApi struct {
	// contains filtered or unexported fields
}

func (*CatApi) Aliases

func (c *CatApi) Aliases() (string, error)

func (*CatApi) Allocation

func (c *CatApi) Allocation() (string, error)

func (*CatApi) Count

func (c *CatApi) Count(s ...string) (string, error)

func (*CatApi) Fielddata

func (c *CatApi) Fielddata(q ...string) (string, error)

func (*CatApi) Health

func (c *CatApi) Health() (string, error)

func (*CatApi) Indices

func (c *CatApi) Indices(q ...string) (string, error)

func (*CatApi) Master

func (c *CatApi) Master() (string, error)

func (*CatApi) Nodes

func (c *CatApi) Nodes() (string, error)

func (*CatApi) PendingTasks

func (c *CatApi) PendingTasks() (string, error)

func (*CatApi) Plugins

func (c *CatApi) Plugins() (string, error)

func (*CatApi) Recovery

func (c *CatApi) Recovery() (string, error)

func (*CatApi) Shards

func (c *CatApi) Shards(q ...string) (string, error)

func (*CatApi) ThreadPool

func (c *CatApi) ThreadPool() (string, error)

func (*CatApi) V

func (c *CatApi) V(v bool)

type ChildrenAggregation

type ChildrenAggregation struct {
	Json *simplejson.Json `json:"children"`
	// contains filtered or unexported fields
}

func (*ChildrenAggregation) Aggs

func (*ChildrenAggregation) Type

type ClusterHealth

type ClusterHealth struct {
	ClusterName         string `json:"cluster_name"`
	Status              string `json:"status"`
	TimedOut            bool   `json:"timed_out"`
	NumberOfNodes       int    `json:"number_of_nodes"`
	NumberOfDataNodes   int    `json:"number_of_data_nodes"`
	ActivePrimaryShards int    `json:"active_primary_shards"`
	ActiveShards        int    `json:"active_shards"`
	RelocatingShards    int    `json:"relocating_shards"`
	InitializingShards  int    `json:"initializing_shards"`
	UnassignedShards    int    `json:"unassigned_shards"`
}

type ClusterSettings

type ClusterSettings struct {
	Transient  map[string]int `json:"transient"`
	Persistent map[string]int `json:"persistent"`
}

type ClusterState

type ClusterState struct {
	ClusterName  string                      `json:"cluster_name"`
	MasterNode   string                      `json:"master_node"`
	Version      string                      `json:"version"`
	Nodes        map[string]ClusterStateNode `json:"nodes"`
	Metadata     simplejson.Json             `json:"metadata"`
	RoutingTable simplejson.Json             `json:"routing_table"` // TODO: Routing Table
	RoutingNodes simplejson.Json             `json:"routing_nodes"` // TODO: Routing Nodes
	Allocations  simplejson.Json             `json:"allocations"`   // TODO: Allocations
}

type ClusterStateNode

type ClusterStateNode struct {
	Name             string          `json:"name"`
	TransportAddress string          `json:"transport_address"`
	Attributes       simplejson.Json `json:"attributes"` // TODO: Attributes
}

type ClusterStats

type ClusterStats struct {
	ClusterName string          `json:"cluster_name"`
	Timestamp   int64           `json:"timestamp"`
	Status      string          `json:"status"`
	Indices     simplejson.Json `json:"indices"`
	Nodes       simplejson.Json `json:"nodes"`
}

type CommonQuery

type CommonQuery struct {
	Json *simplejson.Json `json:"common"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.html

func Common

func Common() *CommonQuery

func (*CommonQuery) Encode

func (j *CommonQuery) Encode() []byte

func (*CommonQuery) Frequency

func (j *CommonQuery) Frequency(v interface{}) *CommonQuery

func (*CommonQuery) MinimumShouldMatch

func (j *CommonQuery) MinimumShouldMatch(v interface{}) *CommonQuery

func (*CommonQuery) Operator

func (j *CommonQuery) Operator(v interface{}) *CommonQuery

func (*CommonQuery) Query

func (j *CommonQuery) Query(v interface{}) *CommonQuery

type ConstantQuery

type ConstantQuery struct {
	Json *simplejson.Json `json:"constant_score"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html

func Constant

func Constant() *ConstantQuery

func (*ConstantQuery) Boost

func (j *ConstantQuery) Boost(v float64) *ConstantQuery

func (*ConstantQuery) Encode

func (j *ConstantQuery) Encode() []byte

func (*ConstantQuery) Filter

func (j *ConstantQuery) Filter(v interface{}) *ConstantQuery

func (*ConstantQuery) Query

func (j *ConstantQuery) Query(v interface{}) *ConstantQuery

type DateHistogramAggregation

type DateHistogramAggregation struct {
	Json *simplejson.Json `json:"date_histogram"`
	// contains filtered or unexported fields
}

func (*DateHistogramAggregation) Aggs

func (*DateHistogramAggregation) Field

func (*DateHistogramAggregation) Format

func (*DateHistogramAggregation) Interval

type DateHistogramFacets

type DateHistogramFacets struct {
	Json *simplejson.Json `json:"date_histogram"`
	// contains filtered or unexported fields
}

func (*DateHistogramFacets) Facet

func (j *DateHistogramFacets) Facet() *SearchFacet

func (*DateHistogramFacets) Factor

func (*DateHistogramFacets) Field

func (*DateHistogramFacets) Interval

func (*DateHistogramFacets) KeyField

func (*DateHistogramFacets) KeyScript

func (*DateHistogramFacets) PostOffset

func (*DateHistogramFacets) PostZone

func (*DateHistogramFacets) PreOffset

func (*DateHistogramFacets) PreZone

func (*DateHistogramFacets) PreZoneAdjustLargeInterval

func (j *DateHistogramFacets) PreZoneAdjustLargeInterval(v bool) *DateHistogramFacets

func (*DateHistogramFacets) TimeZone

func (*DateHistogramFacets) ValueField

func (*DateHistogramFacets) ValueScript

func (j *DateHistogramFacets) ValueScript(v string) *DateHistogramFacets

type DateRangeAggregation

type DateRangeAggregation struct {
	Json *simplejson.Json `json:"date_range"`
	// contains filtered or unexported fields
}

func (*DateRangeAggregation) Aggs

func (*DateRangeAggregation) Field

func (*DateRangeAggregation) Format

func (*DateRangeAggregation) Ranges

func (j *DateRangeAggregation) Ranges(v ...map[string]interface{}) *DateRangeAggregation

type DisjunctionMaxQuery

type DisjunctionMaxQuery struct {
	Json *simplejson.Json `json:"dis_max"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-dis-max-query.html

func DisjunctionMax

func DisjunctionMax() *DisjunctionMaxQuery

func (*DisjunctionMaxQuery) Boost

func (*DisjunctionMaxQuery) Encode

func (j *DisjunctionMaxQuery) Encode() []byte

func (*DisjunctionMaxQuery) Query

func (j *DisjunctionMaxQuery) Query(v ...interface{}) *DisjunctionMaxQuery

func (*DisjunctionMaxQuery) TieBreaker

type DocDsl

type DocDsl struct {
	*simplejson.Json
}

func Doc

func Doc() *DocDsl

func (*DocDsl) Encode

func (d *DocDsl) Encode() []byte

func (*DocDsl) Fileds

func (d *DocDsl) Fileds(v ...string) *DocDsl

func (*DocDsl) Id

func (d *DocDsl) Id(v string) *DocDsl

func (*DocDsl) Index

func (d *DocDsl) Index(v string) *DocDsl

func (*DocDsl) Routing

func (d *DocDsl) Routing(v string) *DocDsl

func (*DocDsl) Source

func (d *DocDsl) Source(v interface{}) *DocDsl

func (*DocDsl) Type

func (d *DocDsl) Type(v string) *DocDsl

type ExistsFilter

type ExistsFilter struct {
	Json *simplejson.Json `json:"exists"`
}

func Exists

func Exists() *ExistsFilter

func (*ExistsFilter) Field

func (j *ExistsFilter) Field(v string) *ExistsFilter

type Explanation

type Explanation struct {
	Value       float64        `json:"value"`
	Description string         `json:"description"`
	Details     []*Explanation `json:"details,omitempty"`
}

type ExtendedStatsAggregation

type ExtendedStatsAggregation struct {
	Json *simplejson.Json `json:"extended_stats"`
	// contains filtered or unexported fields
}

func (*ExtendedStatsAggregation) Aggs

func (*ExtendedStatsAggregation) Field

func (*ExtendedStatsAggregation) Params

func (j *ExtendedStatsAggregation) Params(k string, v interface{}) *ExtendedStatsAggregation

func (*ExtendedStatsAggregation) Script

type Failure

type Failure struct {
	Index  string    `json:"index"`
	Shard  StatusInt `json:"shard"`
	Reason string    `json:"reason"`
}

type FilteredQuery

type FilteredQuery struct {
	Json *simplejson.Json `json:"filtered"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html

func Filtered

func Filtered() *FilteredQuery

func (*FilteredQuery) Encode

func (j *FilteredQuery) Encode() []byte

func (*FilteredQuery) Filter

func (j *FilteredQuery) Filter(v ...interface{}) *FilteredQuery

func (*FilteredQuery) Query

func (j *FilteredQuery) Query(v ...interface{}) *FilteredQuery

func (*FilteredQuery) Strategy

func (j *FilteredQuery) Strategy(v string) *FilteredQuery

strategy parameter (leap_frog_query_first,leap_frog_filter_first,leap_frog,query_first,random_access_${threshold},random_access_always) http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html#_filter_strategy

type Float64Nullable

type Float64Nullable float64

Elasticsearch returns some invalid (according to go) json, with floats having...

json: cannot unmarshal null into Go value of type float64 (see last field.)

"hits":{"total":6808,"max_score":null,

"hits":[{"_index":"10user","_type":"user","_id":"751820","_score":null,

func (*Float64Nullable) UnmarshalJSON

func (i *Float64Nullable) UnmarshalJSON(data []byte) error

type FuzzyLikeThisFiedQuery

type FuzzyLikeThisFiedQuery struct {
	Json *simplejson.Json `json:"fuzzy_like_this_field"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-field-query.html

func FltField

func FltField(field string) *FuzzyLikeThisFiedQuery

func (*FuzzyLikeThisFiedQuery) Analyzer

func (j *FuzzyLikeThisFiedQuery) Analyzer(v interface{}) *FuzzyLikeThisFiedQuery

func (*FuzzyLikeThisFiedQuery) Boost

func (*FuzzyLikeThisFiedQuery) Encode

func (j *FuzzyLikeThisFiedQuery) Encode() []byte

func (*FuzzyLikeThisFiedQuery) Fuzziness

func (*FuzzyLikeThisFiedQuery) IgnoreTf

func (*FuzzyLikeThisFiedQuery) LikeText

func (j *FuzzyLikeThisFiedQuery) LikeText(v interface{}) *FuzzyLikeThisFiedQuery

func (*FuzzyLikeThisFiedQuery) MaxQueryTerms

func (j *FuzzyLikeThisFiedQuery) MaxQueryTerms(v int) *FuzzyLikeThisFiedQuery

func (*FuzzyLikeThisFiedQuery) PrefixLength

type FuzzyLikeThisQuery

type FuzzyLikeThisQuery struct {
	Json *simplejson.Json `json:"fuzzy_like_this"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-query.html

func Flt

func Flt() *FuzzyLikeThisQuery

func (*FuzzyLikeThisQuery) Analyzer

func (j *FuzzyLikeThisQuery) Analyzer(v interface{}) *FuzzyLikeThisQuery

func (*FuzzyLikeThisQuery) Boost

func (*FuzzyLikeThisQuery) Encode

func (j *FuzzyLikeThisQuery) Encode() []byte

func (*FuzzyLikeThisQuery) Fields

func (j *FuzzyLikeThisQuery) Fields(v ...interface{}) *FuzzyLikeThisQuery

func (*FuzzyLikeThisQuery) Fuzziness

func (*FuzzyLikeThisQuery) IgnoreTf

func (j *FuzzyLikeThisQuery) IgnoreTf(v bool) *FuzzyLikeThisQuery

func (*FuzzyLikeThisQuery) LikeText

func (j *FuzzyLikeThisQuery) LikeText(v interface{}) *FuzzyLikeThisQuery

func (*FuzzyLikeThisQuery) MaxQueryTerms

func (j *FuzzyLikeThisQuery) MaxQueryTerms(v int) *FuzzyLikeThisQuery

func (*FuzzyLikeThisQuery) PrefixLength

func (j *FuzzyLikeThisQuery) PrefixLength(v int) *FuzzyLikeThisQuery

type FuzzyQuery

type FuzzyQuery struct {
	Json *simplejson.Json `json:"fuzzy"`
	// contains filtered or unexported fields
}

func Fuzzy

func Fuzzy(field string) *FuzzyQuery

func (*FuzzyQuery) Boost

func (j *FuzzyQuery) Boost(v float64) *FuzzyQuery

func (*FuzzyQuery) Encode

func (j *FuzzyQuery) Encode() []byte

func (*FuzzyQuery) Fuzziness

func (j *FuzzyQuery) Fuzziness(v interface{}) *FuzzyQuery

func (*FuzzyQuery) Fuzzy

func (j *FuzzyQuery) Fuzzy(v interface{}) *FuzzyQuery

func (*FuzzyQuery) MaxExpansions

func (j *FuzzyQuery) MaxExpansions(v int) *FuzzyQuery

func (*FuzzyQuery) PrefixLength

func (j *FuzzyQuery) PrefixLength(v int) *FuzzyQuery

func (*FuzzyQuery) Value

func (j *FuzzyQuery) Value(v interface{}) *FuzzyQuery

type GeoBoundingBoxFilter

type GeoBoundingBoxFilter struct {
	Json *simplejson.Json `json:"geo_bounding_box"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-filter.html

func GeoBoundingBox

func GeoBoundingBox() *GeoBoundingBoxFilter

func (*GeoBoundingBoxFilter) BottomRight

func (j *GeoBoundingBoxFilter) BottomRight(v interface{}) *GeoBoundingBoxFilter

func (*GeoBoundingBoxFilter) TopLeft

func (j *GeoBoundingBoxFilter) TopLeft(v interface{}) *GeoBoundingBoxFilter

type GeoBoundsAggregation

type GeoBoundsAggregation struct {
	Json *simplejson.Json `json:"geo_bounds"`
	// contains filtered or unexported fields
}

func (*GeoBoundsAggregation) Aggs

func (*GeoBoundsAggregation) Field

func (*GeoBoundsAggregation) WrapLongitude

func (j *GeoBoundsAggregation) WrapLongitude(v string) *GeoBoundsAggregation

type GeoDistanceFacets

type GeoDistanceFacets struct {
	Json *simplejson.Json `json:"terms_stats"`
	// contains filtered or unexported fields
}

func (*GeoDistanceFacets) Facet

func (j *GeoDistanceFacets) Facet() *SearchFacet

func (*GeoDistanceFacets) Params

func (j *GeoDistanceFacets) Params(v map[string]interface{}) *GeoDistanceFacets

func (*GeoDistanceFacets) PinLocation

func (j *GeoDistanceFacets) PinLocation(v interface{}) *GeoDistanceFacets

func (*GeoDistanceFacets) Ranges

func (j *GeoDistanceFacets) Ranges(v ...interface{}) *GeoDistanceFacets

func (*GeoDistanceFacets) ValueField

func (j *GeoDistanceFacets) ValueField(v string) *GeoDistanceFacets

func (*GeoDistanceFacets) ValueScript

func (j *GeoDistanceFacets) ValueScript(v string) *GeoDistanceFacets

type GeoDistanceFilter

type GeoDistanceFilter struct {
	Json *simplejson.Json `json:"geo_distance"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-filter.html

func GeoDistance

func GeoDistance() *GeoDistanceFilter

func (*GeoDistanceFilter) Distance

func (j *GeoDistanceFilter) Distance(v interface{}) *GeoDistanceFilter

func (*GeoDistanceFilter) DistanceType

func (j *GeoDistanceFilter) DistanceType(v interface{}) *GeoDistanceFilter

func (*GeoDistanceFilter) OptimizeBbox

func (j *GeoDistanceFilter) OptimizeBbox(v interface{}) *GeoDistanceFilter

func (*GeoDistanceFilter) PinLocation

func (j *GeoDistanceFilter) PinLocation(v interface{}) *GeoDistanceFilter

type GeoDistanceRangeFilter

type GeoDistanceRangeFilter struct {
	Json *simplejson.Json `json:"geo_distance_range"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-range-filter.html

func GeoDistanceRange

func GeoDistanceRange() *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) Cache

func (*GeoDistanceRangeFilter) From

func (j *GeoDistanceRangeFilter) From(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) Gt

func (j *GeoDistanceRangeFilter) Gt(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) Gte

func (j *GeoDistanceRangeFilter) Gte(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) IncludeLower

func (j *GeoDistanceRangeFilter) IncludeLower(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) IncludeUpper

func (j *GeoDistanceRangeFilter) IncludeUpper(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) Lt

func (j *GeoDistanceRangeFilter) Lt(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) Lte

func (j *GeoDistanceRangeFilter) Lte(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) PinLocation

func (j *GeoDistanceRangeFilter) PinLocation(v interface{}) *GeoDistanceRangeFilter

func (*GeoDistanceRangeFilter) To

func (j *GeoDistanceRangeFilter) To(v interface{}) *GeoDistanceRangeFilter

type GeoPolygonFilter

type GeoPolygonFilter struct {
	Json *simplejson.Json `json:"geo_polygon"`
}

func GeoPolygon

func GeoPolygon() *GeoPolygonFilter

func (*GeoPolygonFilter) Cache

func (j *GeoPolygonFilter) Cache(v bool) *GeoPolygonFilter

func (*GeoPolygonFilter) Points

func (j *GeoPolygonFilter) Points(v ...interface{}) *GeoPolygonFilter

type GeoShapeQuery

type GeoShapeQuery struct {
	Json *simplejson.Json `json:"geo_shape"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html

func GeoShape

func GeoShape() *GeoShapeQuery

func (*GeoShapeQuery) Coordinates

func (j *GeoShapeQuery) Coordinates(v interface{}) *GeoShapeQuery

func (*GeoShapeQuery) Encode

func (j *GeoShapeQuery) Encode() []byte

func (*GeoShapeQuery) Type

func (j *GeoShapeQuery) Type(v string) *GeoShapeQuery

type GeohashCellFilter

type GeohashCellFilter struct {
	Json *simplejson.Json `json:"geohash_cell"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geohash-cell-filter.html

func GeohashCell

func GeohashCell() *GeohashCellFilter

func (*GeohashCellFilter) Cache

func (*GeohashCellFilter) Lat

func (j *GeohashCellFilter) Lat(v interface{}) *GeohashCellFilter

func (*GeohashCellFilter) Lon

func (j *GeohashCellFilter) Lon(v interface{}) *GeohashCellFilter

func (*GeohashCellFilter) Neighbors

func (j *GeohashCellFilter) Neighbors(v bool) *GeohashCellFilter

func (*GeohashCellFilter) Precision

func (j *GeohashCellFilter) Precision(v interface{}) *GeohashCellFilter

type HasChildQuery

type HasChildQuery struct {
	Json *simplejson.Json `json:"has_child"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html

func HasChild

func HasChild() *HasChildQuery

func (*HasChildQuery) Encode

func (j *HasChildQuery) Encode() []byte

func (*HasChildQuery) Filter

func (j *HasChildQuery) Filter(v interface{}) *HasChildQuery

func (*HasChildQuery) MaxChildren

func (j *HasChildQuery) MaxChildren(v int) *HasChildQuery

func (*HasChildQuery) MinChildren

func (j *HasChildQuery) MinChildren(v int) *HasChildQuery

func (*HasChildQuery) Query

func (j *HasChildQuery) Query(v interface{}) *HasChildQuery

func (*HasChildQuery) ScoreMode

func (j *HasChildQuery) ScoreMode(v string) *HasChildQuery

func (*HasChildQuery) Type

func (j *HasChildQuery) Type(v string) *HasChildQuery

type HasParentQuery

type HasParentQuery struct {
	Json *simplejson.Json `json:"has_parent"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-parent-query.html

func HasParent

func HasParent() *HasParentQuery

func (*HasParentQuery) Encode

func (j *HasParentQuery) Encode() []byte

func (*HasParentQuery) Filter

func (j *HasParentQuery) Filter(v interface{}) *HasParentQuery

func (*HasParentQuery) Query

func (j *HasParentQuery) Query(v interface{}) *HasParentQuery

func (*HasParentQuery) ScoreMode

func (j *HasParentQuery) ScoreMode(v string) *HasParentQuery

func (*HasParentQuery) Type

func (j *HasParentQuery) Type(v string) *HasParentQuery

type HighlightClass

type HighlightClass map[string][]string

type HistogramAggregation

type HistogramAggregation struct {
	Json *simplejson.Json `json:"histogram"`
	// contains filtered or unexported fields
}

func (*HistogramAggregation) Aggs

func (*HistogramAggregation) Field

func (*HistogramAggregation) Interval

func (*HistogramAggregation) Keyed

func (*HistogramAggregation) MinDocCount

func (j *HistogramAggregation) MinDocCount(v int) *HistogramAggregation

func (*HistogramAggregation) Order

type HistogramFacets

type HistogramFacets struct {
	Json *simplejson.Json `json:"histogram"`
	// contains filtered or unexported fields
}

func (*HistogramFacets) Facet

func (j *HistogramFacets) Facet() *SearchFacet

func (*HistogramFacets) Field

func (j *HistogramFacets) Field(v string) *HistogramFacets

func (*HistogramFacets) Interval

func (j *HistogramFacets) Interval(v int) *HistogramFacets

func (*HistogramFacets) KeyField

func (j *HistogramFacets) KeyField(v string) *HistogramFacets

func (*HistogramFacets) KeyScript

func (j *HistogramFacets) KeyScript(v string) *HistogramFacets

func (*HistogramFacets) Params

func (j *HistogramFacets) Params(v map[string]interface{}) *HistogramFacets

func (*HistogramFacets) TimeInterval

func (j *HistogramFacets) TimeInterval(v string) *HistogramFacets

func (*HistogramFacets) ValueField

func (j *HistogramFacets) ValueField(v string) *HistogramFacets

func (*HistogramFacets) ValueScript

func (j *HistogramFacets) ValueScript(v string) *HistogramFacets

type Hit

type Hit struct {
	Index string  `json:"_index"`
	Type  string  `json:"_type,omitempty"`
	Id    string  `json:"_id"`
	Score float64 `json:"_score,omitempty"` // Filters (no query) dont have score, so is null
	//Score       Float64Nullable  `json:"_score,omitempty"` // Filters (no query) dont have score, so is null
	Source      *json.RawMessage `json:"_source"` // marshalling left to consumer
	Fields      *json.RawMessage `json:"fields"`  // when a field arg is passed to ES, instead of _source it returns fields
	Explanation *Explanation     `json:"_explanation,omitempty"`
	Highlight   *HighlightClass  `json:"highlight,omitempty"`
}

type Hits

type Hits struct {
	Total int `json:"total"`
	//	MaxScore float32 `json:"max_score"`
	Hits []Hit `json:"hits"`
}

func (*Hits) Len

func (h *Hits) Len() int

type IdsQuery

type IdsQuery struct {
	Json *simplejson.Json `json:"ids"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html

func Ids

func Ids() *IdsQuery

func (*IdsQuery) Encode

func (j *IdsQuery) Encode() []byte

func (*IdsQuery) Type

func (j *IdsQuery) Type(v ...string) *IdsQuery

func (*IdsQuery) Values

func (j *IdsQuery) Values(v ...interface{}) *IdsQuery

type IndicesApi

type IndicesApi struct {
	// contains filtered or unexported fields
}

func (*IndicesApi) CleanCache

func (s *IndicesApi) CleanCache(index ...string) (string, error)

clean Cache

func (*IndicesApi) Delete

func (s *IndicesApi) Delete(index ...string) (string, error)

delete

func (*IndicesApi) Exists

func (s *IndicesApi) Exists(index, _type string) (bool, error)

delete

func (*IndicesApi) Flush

func (s *IndicesApi) Flush(index ...string) (string, error)

flush

func (*IndicesApi) Optimize

func (s *IndicesApi) Optimize(index ...string) (string, error)

optimize

func (*IndicesApi) Refresh

func (s *IndicesApi) Refresh(index ...string) (string, error)

refresh

func (*IndicesApi) Status

func (s *IndicesApi) Status(index ...string) (string, error)

status

type IndicesQuery

type IndicesQuery struct {
	Json *simplejson.Json `json:"indices"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html

func Indices

func Indices() *IndicesQuery

func (*IndicesQuery) Encode

func (j *IndicesQuery) Encode() []byte

func (*IndicesQuery) Filter

func (j *IndicesQuery) Filter(v interface{}) *IndicesQuery

func (*IndicesQuery) Indices

func (j *IndicesQuery) Indices(v ...string) *IndicesQuery

func (*IndicesQuery) NoMatchFilter

func (j *IndicesQuery) NoMatchFilter(v interface{}) *IndicesQuery

func (*IndicesQuery) NoMatchQuery

func (j *IndicesQuery) NoMatchQuery(v interface{}) *IndicesQuery

func (*IndicesQuery) Query

func (j *IndicesQuery) Query(v interface{}) *IndicesQuery

type IpRangeAggregation

type IpRangeAggregation struct {
	Json *simplejson.Json `json:"ip_range"`
	// contains filtered or unexported fields
}

func (*IpRangeAggregation) Aggs

func (*IpRangeAggregation) Field

func (*IpRangeAggregation) Ranges

func (j *IpRangeAggregation) Ranges(v ...map[string]interface{}) *IpRangeAggregation

type Jsoner

type Jsoner interface {
	Encode() []byte
}

type MatchPhrasePrefixQuery

type MatchPhrasePrefixQuery struct {
	Json *simplejson.Json `json:"match_phrase_prefix"`
	// contains filtered or unexported fields
}

func MatchPhrasePrefix

func MatchPhrasePrefix(field string) *MatchPhrasePrefixQuery

func (*MatchPhrasePrefixQuery) Encode

func (j *MatchPhrasePrefixQuery) Encode() []byte

func (*MatchPhrasePrefixQuery) MaxExpansions

func (j *MatchPhrasePrefixQuery) MaxExpansions(v interface{}) *MatchPhrasePrefixQuery

func (*MatchPhrasePrefixQuery) Query

func (j *MatchPhrasePrefixQuery) Query(v interface{}) *MatchPhrasePrefixQuery

func (*MatchPhrasePrefixQuery) Value

func (j *MatchPhrasePrefixQuery) Value(v interface{}) *MatchPhrasePrefixQuery

type MatchPhraseQuery

type MatchPhraseQuery struct {
	Json *simplejson.Json `json:"match_phrase"`
	// contains filtered or unexported fields
}

func MatchPhrase

func MatchPhrase(field string) *MatchPhraseQuery

func (*MatchPhraseQuery) Analyzer

func (j *MatchPhraseQuery) Analyzer(v interface{}) *MatchPhraseQuery

func (*MatchPhraseQuery) Boost

func (*MatchPhraseQuery) Encode

func (j *MatchPhraseQuery) Encode() []byte

func (*MatchPhraseQuery) PhraseSlop

func (j *MatchPhraseQuery) PhraseSlop(v int) *MatchPhraseQuery

func (*MatchPhraseQuery) Query

func (j *MatchPhraseQuery) Query(v interface{}) *MatchPhraseQuery

func (*MatchPhraseQuery) Value

func (j *MatchPhraseQuery) Value(v interface{}) *MatchPhraseQuery

type MatchQuery

type MatchQuery struct {
	Json *simplejson.Json `json:"match"`
	// contains filtered or unexported fields
}

v is map[string]string map["query"]="this is a test" map["operator"]="and" http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

func Match

func Match(field string) *MatchQuery

func (*MatchQuery) CutOffFrequency

func (j *MatchQuery) CutOffFrequency(p float64) *MatchQuery

range [0..1)

func (*MatchQuery) Encode

func (j *MatchQuery) Encode() []byte

func (*MatchQuery) Operator

func (j *MatchQuery) Operator(operator string) *MatchQuery

func (*MatchQuery) Query

func (j *MatchQuery) Query(v interface{}) *MatchQuery

func (*MatchQuery) Slop

func (j *MatchQuery) Slop(p int) *MatchQuery

func (*MatchQuery) Type

func (j *MatchQuery) Type(p string) *MatchQuery

phrase, phrase_prefix

func (*MatchQuery) Value

func (j *MatchQuery) Value(v interface{}) *MatchQuery

func (*MatchQuery) ZeroTermsQuery

func (j *MatchQuery) ZeroTermsQuery(p string) *MatchQuery

none or all

type MaxAggregation

type MaxAggregation struct {
	Json *simplejson.Json `json:"max"`
	// contains filtered or unexported fields
}

func (*MaxAggregation) Aggs

func (j *MaxAggregation) Aggs() *SearchAggregation

func (*MaxAggregation) Field

func (j *MaxAggregation) Field(field string) *MaxAggregation

func (*MaxAggregation) Params

func (j *MaxAggregation) Params(k string, v interface{}) *MaxAggregation

func (*MaxAggregation) Script

func (j *MaxAggregation) Script(v string) *MaxAggregation

type MinAggregation

type MinAggregation struct {
	Json *simplejson.Json `json:"min"`
	// contains filtered or unexported fields
}

func (*MinAggregation) Aggs

func (j *MinAggregation) Aggs() *SearchAggregation

func (*MinAggregation) Field

func (j *MinAggregation) Field(field string) *MinAggregation

func (*MinAggregation) Params

func (j *MinAggregation) Params(k string, v interface{}) *MinAggregation

func (*MinAggregation) Script

func (j *MinAggregation) Script(v string) *MinAggregation

type MissingAggregation

type MissingAggregation struct {
	Json *simplejson.Json `json:"missing"`
	// contains filtered or unexported fields
}

func (*MissingAggregation) Aggs

func (*MissingAggregation) Field

func (j *MissingAggregation) Field(field string) *MissingAggregation

type MissingFilter

type MissingFilter struct {
	Json *simplejson.Json `json:"missing"`
}

func Missing

func Missing() *MissingFilter

func (*MissingFilter) Existence

func (j *MissingFilter) Existence(v bool) *MissingFilter

func (*MissingFilter) Field

func (j *MissingFilter) Field(v string) *MissingFilter

func (*MissingFilter) NullValue

func (j *MissingFilter) NullValue(v bool) *MissingFilter

type MoreLikeThisFieldQuery

type MoreLikeThisFieldQuery struct {
	Json *simplejson.Json `json:"more_like_this_field"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-mlt-field-query.html

func MoreLikeThisField

func MoreLikeThisField(field string) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) Analyzer

func (j *MoreLikeThisFieldQuery) Analyzer(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) Boost

func (j *MoreLikeThisFieldQuery) Boost(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) BoostTerms

func (j *MoreLikeThisFieldQuery) BoostTerms(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) Encode

func (j *MoreLikeThisFieldQuery) Encode() []byte

func (*MoreLikeThisFieldQuery) LikeText

func (*MoreLikeThisFieldQuery) MaxDocFreq

func (j *MoreLikeThisFieldQuery) MaxDocFreq(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) MaxQueryTerms

func (j *MoreLikeThisFieldQuery) MaxQueryTerms(v int) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) MaxWordLength

func (j *MoreLikeThisFieldQuery) MaxWordLength(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) MinDocFreq

func (j *MoreLikeThisFieldQuery) MinDocFreq(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) MinTermFreq

func (*MoreLikeThisFieldQuery) MinWordLength

func (j *MoreLikeThisFieldQuery) MinWordLength(v interface{}) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) PercentTermsToMatch

func (j *MoreLikeThisFieldQuery) PercentTermsToMatch(v float64) *MoreLikeThisFieldQuery

func (*MoreLikeThisFieldQuery) StopWords

func (j *MoreLikeThisFieldQuery) StopWords(v interface{}) *MoreLikeThisFieldQuery

type MoreLikeThisQuery

type MoreLikeThisQuery struct {
	Json *simplejson.Json `json:"more_like_this"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html

func MoreLikeThis

func MoreLikeThis() *MoreLikeThisQuery

func (*MoreLikeThisQuery) Analyzer

func (j *MoreLikeThisQuery) Analyzer(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) Boost

func (j *MoreLikeThisQuery) Boost(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) BoostTerms

func (j *MoreLikeThisQuery) BoostTerms(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) Docs

func (j *MoreLikeThisQuery) Docs(v ...interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) Encode

func (j *MoreLikeThisQuery) Encode() []byte

func (*MoreLikeThisQuery) Exclude

func (j *MoreLikeThisQuery) Exclude(v bool) *MoreLikeThisQuery

func (*MoreLikeThisQuery) Fields

func (j *MoreLikeThisQuery) Fields(v ...string) *MoreLikeThisQuery

func (*MoreLikeThisQuery) Ids

func (*MoreLikeThisQuery) Include

func (j *MoreLikeThisQuery) Include(v bool) *MoreLikeThisQuery

func (*MoreLikeThisQuery) LikeText

func (j *MoreLikeThisQuery) LikeText(v string) *MoreLikeThisQuery

func (*MoreLikeThisQuery) MaxDocFreq

func (j *MoreLikeThisQuery) MaxDocFreq(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) MaxQueryTerms

func (j *MoreLikeThisQuery) MaxQueryTerms(v int) *MoreLikeThisQuery

func (*MoreLikeThisQuery) MaxWordLength

func (j *MoreLikeThisQuery) MaxWordLength(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) MinDocFreq

func (j *MoreLikeThisQuery) MinDocFreq(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) MinTermFreq

func (j *MoreLikeThisQuery) MinTermFreq(v int) *MoreLikeThisQuery

func (*MoreLikeThisQuery) MinWordLength

func (j *MoreLikeThisQuery) MinWordLength(v interface{}) *MoreLikeThisQuery

func (*MoreLikeThisQuery) PercentTermsToMatch

func (j *MoreLikeThisQuery) PercentTermsToMatch(v float64) *MoreLikeThisQuery

func (*MoreLikeThisQuery) StopWords

func (j *MoreLikeThisQuery) StopWords(v interface{}) *MoreLikeThisQuery

type MoveCommand

type MoveCommand struct {
	Json *simplejson.Json `json:"move"`
}

func Move

func Move() *MoveCommand

func (*MoveCommand) FromNode

func (c *MoveCommand) FromNode(val string) *MoveCommand

func (*MoveCommand) Index

func (c *MoveCommand) Index(val string) *MoveCommand

func (*MoveCommand) Shard

func (c *MoveCommand) Shard(val int) *MoveCommand

func (*MoveCommand) ToNode

func (c *MoveCommand) ToNode(val string) *MoveCommand

type MultiMatchQuery

type MultiMatchQuery struct {
	Json *simplejson.Json `json:"multi_match"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html

func MultiMatch

func MultiMatch() *MultiMatchQuery

func (*MultiMatchQuery) Encode

func (j *MultiMatchQuery) Encode() []byte

func (*MultiMatchQuery) Field

func (j *MultiMatchQuery) Field(field ...string) *MultiMatchQuery

func (*MultiMatchQuery) Operator

func (j *MultiMatchQuery) Operator(operator string) *MultiMatchQuery

func (*MultiMatchQuery) Query

func (j *MultiMatchQuery) Query(query string) *MultiMatchQuery

func (*MultiMatchQuery) Type

func (j *MultiMatchQuery) Type(_type string) *MultiMatchQuery

type parameter best_fields,most_fields,cross_fields,phrase,phrase_prefix http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#multi-match-types

type NestedAggregation

type NestedAggregation struct {
	Json *simplejson.Json `json:"nested"`
	// contains filtered or unexported fields
}

func (*NestedAggregation) Aggs

func (*NestedAggregation) Path

type NestedQuery

type NestedQuery struct {
	Json *simplejson.Json `json:"nested"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html#query-dsl-nested-query

func Nested

func Nested() *NestedQuery

func (*NestedQuery) Cache

func (j *NestedQuery) Cache(v bool) *NestedQuery

func (*NestedQuery) Encode

func (j *NestedQuery) Encode() []byte

func (*NestedQuery) Filter

func (j *NestedQuery) Filter(v interface{}) *NestedQuery

func (*NestedQuery) Join

func (j *NestedQuery) Join(v bool) *NestedQuery

func (*NestedQuery) Path

func (j *NestedQuery) Path(v string) *NestedQuery

func (*NestedQuery) Query

func (j *NestedQuery) Query(v interface{}) *NestedQuery

func (*NestedQuery) ScoreMode

func (j *NestedQuery) ScoreMode(v string) *NestedQuery

type NodeStats

type NodeStats struct {
	ClusterName string          `json:"cluster_name"`
	Nodes       simplejson.Json `json:"nodes"`
}

type NotFilter

type NotFilter struct {
	Json *simplejson.Json `json:"not"`
}

func Not

func Not() *NotFilter

func (*NotFilter) Cache

func (j *NotFilter) Cache(v bool) *NotFilter

func (*NotFilter) Filters

func (j *NotFilter) Filters(v ...interface{}) *NotFilter

func (*NotFilter) Not

func (j *NotFilter) Not(v ...interface{}) interface{}

type OrFilter

type OrFilter struct {
	Json *simplejson.Json `json:"or"`
}

func Or

func Or() *OrFilter

func (*OrFilter) Cache

func (j *OrFilter) Cache(v bool) *OrFilter

func (*OrFilter) Filters

func (j *OrFilter) Filters(v ...interface{}) *OrFilter

func (*OrFilter) Or

func (j *OrFilter) Or(v ...interface{}) interface{}

type PendingTasks

type PendingTasks struct {
	Tasks []Task `json:"tasks"`
}

type PercentileRanksAggregation

type PercentileRanksAggregation struct {
	Json *simplejson.Json `json:"percentile_ranks"`
	// contains filtered or unexported fields
}

func (*PercentileRanksAggregation) Aggs

func (*PercentileRanksAggregation) Field

func (*PercentileRanksAggregation) Script

func (*PercentileRanksAggregation) Value

type PercentilesAggregation

type PercentilesAggregation struct {
	Json *simplejson.Json `json:"percentiles"`
	// contains filtered or unexported fields
}

func (*PercentilesAggregation) Aggs

func (*PercentilesAggregation) Compression

func (*PercentilesAggregation) Field

func (*PercentilesAggregation) Params

func (j *PercentilesAggregation) Params(k string, v interface{}) *PercentilesAggregation

func (*PercentilesAggregation) Percents

func (*PercentilesAggregation) Script

type PrefixQuery

type PrefixQuery struct {
	Json *simplejson.Json `json:"prefix"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html

func Prefix

func Prefix(field string) *PrefixQuery

func (*PrefixQuery) Boost

func (j *PrefixQuery) Boost(v interface{}) *PrefixQuery

func (*PrefixQuery) Cache

func (j *PrefixQuery) Cache(v bool) *PrefixQuery

func (*PrefixQuery) Encode

func (j *PrefixQuery) Encode() []byte

func (*PrefixQuery) Prefix

func (j *PrefixQuery) Prefix(v interface{}) *PrefixQuery

func (*PrefixQuery) Val

func (j *PrefixQuery) Val(v interface{}) *PrefixQuery

func (*PrefixQuery) Value

func (j *PrefixQuery) Value(v interface{}) *PrefixQuery

type QueryStringQuery

type QueryStringQuery struct {
	Json *simplejson.Json `json:"query_string"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

func QueryString

func QueryString() *QueryStringQuery

func (*QueryStringQuery) AllowLeadingWildcard

func (j *QueryStringQuery) AllowLeadingWildcard(v interface{}) *QueryStringQuery

func (*QueryStringQuery) AnalyzeWildcard

func (j *QueryStringQuery) AnalyzeWildcard(v interface{}) *QueryStringQuery

func (*QueryStringQuery) Analyzer

func (j *QueryStringQuery) Analyzer(v interface{}) *QueryStringQuery

func (*QueryStringQuery) AutoGeneratePhraseQueries

func (j *QueryStringQuery) AutoGeneratePhraseQueries(v interface{}) *QueryStringQuery

func (*QueryStringQuery) Boost

func (j *QueryStringQuery) Boost(v interface{}) *QueryStringQuery

func (*QueryStringQuery) DefaultField

func (j *QueryStringQuery) DefaultField(v interface{}) *QueryStringQuery

func (*QueryStringQuery) DefaultOperator

func (j *QueryStringQuery) DefaultOperator(v interface{}) *QueryStringQuery

func (*QueryStringQuery) EnablePositionIncrements

func (j *QueryStringQuery) EnablePositionIncrements(v interface{}) *QueryStringQuery

func (*QueryStringQuery) Encode

func (j *QueryStringQuery) Encode() []byte

func (*QueryStringQuery) Fields

func (j *QueryStringQuery) Fields(v ...interface{}) *QueryStringQuery

func (*QueryStringQuery) Fuzziness

func (j *QueryStringQuery) Fuzziness(v interface{}) *QueryStringQuery

func (*QueryStringQuery) FuzzyMaxExpansions

func (j *QueryStringQuery) FuzzyMaxExpansions(v interface{}) *QueryStringQuery

func (*QueryStringQuery) FuzzyPrefixLength

func (j *QueryStringQuery) FuzzyPrefixLength(v interface{}) *QueryStringQuery

func (*QueryStringQuery) Lenient

func (j *QueryStringQuery) Lenient(v interface{}) *QueryStringQuery

func (*QueryStringQuery) Locale

func (j *QueryStringQuery) Locale(v interface{}) *QueryStringQuery

func (*QueryStringQuery) LowercaseExpandedTerms

func (j *QueryStringQuery) LowercaseExpandedTerms(v interface{}) *QueryStringQuery

func (*QueryStringQuery) MinimumShouldMatch

func (j *QueryStringQuery) MinimumShouldMatch(v interface{}) *QueryStringQuery

func (*QueryStringQuery) Query

func (j *QueryStringQuery) Query(v interface{}) *QueryStringQuery

type RangeAggregation

type RangeAggregation struct {
	Json *simplejson.Json `json:"range"`
	// contains filtered or unexported fields
}

func (*RangeAggregation) Aggs

func (*RangeAggregation) Field

func (*RangeAggregation) Keyed

func (j *RangeAggregation) Keyed(v bool) *RangeAggregation

func (*RangeAggregation) Params

func (j *RangeAggregation) Params(k string, v interface{}) *RangeAggregation

func (*RangeAggregation) Ranges

func (j *RangeAggregation) Ranges(v ...map[string]interface{}) *RangeAggregation

func (*RangeAggregation) Script

type RangeFacets

type RangeFacets struct {
	Json *simplejson.Json `json:"range"`
	// contains filtered or unexported fields
}

func (*RangeFacets) Facet

func (j *RangeFacets) Facet() *SearchFacet

func (*RangeFacets) Field

func (j *RangeFacets) Field(v string) *RangeFacets

func (*RangeFacets) KeyField

func (j *RangeFacets) KeyField(v string) *RangeFacets

func (*RangeFacets) KeyScript

func (j *RangeFacets) KeyScript(v string) *RangeFacets

func (*RangeFacets) Ranges

func (j *RangeFacets) Ranges(v ...interface{}) *RangeFacets

func (*RangeFacets) ValueField

func (j *RangeFacets) ValueField(v string) *RangeFacets

func (*RangeFacets) ValueScript

func (j *RangeFacets) ValueScript(v string) *RangeFacets

type RangeQuery

type RangeQuery struct {
	Json *simplejson.Json `json:"range"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-query.html

func Range

func Range(field string) *RangeQuery

func (*RangeQuery) Boost

func (j *RangeQuery) Boost(v float64) *RangeQuery

func (*RangeQuery) Cache

func (j *RangeQuery) Cache(v bool) *RangeQuery

func (*RangeQuery) Encode

func (j *RangeQuery) Encode() []byte

func (*RangeQuery) From

func (j *RangeQuery) From(v interface{}) *RangeQuery

func (*RangeQuery) Gt

func (j *RangeQuery) Gt(v interface{}) *RangeQuery

func (*RangeQuery) Gte

func (j *RangeQuery) Gte(v interface{}) *RangeQuery

func (*RangeQuery) Lt

func (j *RangeQuery) Lt(v interface{}) *RangeQuery

func (*RangeQuery) Lte

func (j *RangeQuery) Lte(v interface{}) *RangeQuery

func (*RangeQuery) TimeZone

func (j *RangeQuery) TimeZone(v interface{}) *RangeQuery

func (*RangeQuery) To

func (j *RangeQuery) To(v interface{}) *RangeQuery

type RegexpQuery

type RegexpQuery struct {
	Json *simplejson.Json `json:"regexp"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html

func Regexp

func Regexp(field string) *RegexpQuery

func (*RegexpQuery) Boost

func (j *RegexpQuery) Boost(v float64) *RegexpQuery

func (*RegexpQuery) Cache

func (j *RegexpQuery) Cache(v bool) *RegexpQuery

func (*RegexpQuery) CacheKey

func (j *RegexpQuery) CacheKey(v string) *RegexpQuery

func (*RegexpQuery) Encode

func (j *RegexpQuery) Encode() []byte

func (*RegexpQuery) Flags

func (j *RegexpQuery) Flags(v string) *RegexpQuery

func (*RegexpQuery) Name

func (j *RegexpQuery) Name(v string) *RegexpQuery

func (*RegexpQuery) Val

func (j *RegexpQuery) Val(v string) *RegexpQuery

func (*RegexpQuery) Value

func (j *RegexpQuery) Value(v string) *RegexpQuery

type ScriptFilter

type ScriptFilter struct {
	Json *simplejson.Json `json:"script"`
}

func Script

func Script() *ScriptFilter

func (*ScriptFilter) Cache

func (j *ScriptFilter) Cache(v bool) *ScriptFilter

func (*ScriptFilter) Map

func (j *ScriptFilter) Map() interface{}

func (*ScriptFilter) Params

func (j *ScriptFilter) Params(k string, v interface{}) *ScriptFilter

func (*ScriptFilter) Script

func (j *ScriptFilter) Script(v interface{}) *ScriptFilter

type ScriptedMetricAggregation

type ScriptedMetricAggregation struct {
	Json *simplejson.Json `json:"scripted_metric"`
	// contains filtered or unexported fields
}

func (*ScriptedMetricAggregation) Aggs

func (*ScriptedMetricAggregation) CombineScript

func (*ScriptedMetricAggregation) InitScript

func (*ScriptedMetricAggregation) MapScript

func (*ScriptedMetricAggregation) ReduceScript

type SearchAggregation

type SearchAggregation struct {
	Json *simplejson.Json `json:"aggs"`
}

func Aggregation

func Aggregation() *SearchAggregation

func (*SearchAggregation) Aggregation

func (j *SearchAggregation) Aggregation(key string, val ...*SearchAggregation) *SearchAggregation

func (*SearchAggregation) Avg

func (j *SearchAggregation) Avg(field string) *AvgAggregation

func (*SearchAggregation) Cardinality

func (j *SearchAggregation) Cardinality(field string) *CardinalityAggregation

func (*SearchAggregation) Children

func (j *SearchAggregation) Children(field string) *ChildrenAggregation

func (*SearchAggregation) DateHistogram

func (j *SearchAggregation) DateHistogram(field string) *DateHistogramAggregation

func (*SearchAggregation) DateRange

func (j *SearchAggregation) DateRange(field string) *DateRangeAggregation

func (*SearchAggregation) Encode

func (j *SearchAggregation) Encode() []byte

func (*SearchAggregation) ExtendedStats

func (j *SearchAggregation) ExtendedStats(field string) *ExtendedStatsAggregation

func (*SearchAggregation) Filter

func (j *SearchAggregation) Filter(field string, v interface{}) *SearchAggregation

func (*SearchAggregation) Filters

func (j *SearchAggregation) Filters(field string, v interface{}) *SearchAggregation

func (*SearchAggregation) GeoBounds

func (j *SearchAggregation) GeoBounds(field string) *GeoBoundsAggregation

func (*SearchAggregation) Global

func (j *SearchAggregation) Global(field string) *SearchAggregation

func (*SearchAggregation) Histogram

func (j *SearchAggregation) Histogram(field string) *HistogramAggregation

func (*SearchAggregation) IpRange

func (j *SearchAggregation) IpRange(field string) *IpRangeAggregation

func (*SearchAggregation) Max

func (j *SearchAggregation) Max(field string) *MaxAggregation

func (*SearchAggregation) Min

func (j *SearchAggregation) Min(field string) *MinAggregation

func (*SearchAggregation) Missing

func (j *SearchAggregation) Missing(field string) *MissingAggregation

func (*SearchAggregation) Nested

func (j *SearchAggregation) Nested(field string) *NestedAggregation

func (*SearchAggregation) PercentileRanks

func (j *SearchAggregation) PercentileRanks(field string) *PercentileRanksAggregation

func (*SearchAggregation) Percentiles

func (j *SearchAggregation) Percentiles(field string) *PercentilesAggregation

func (*SearchAggregation) Range

func (j *SearchAggregation) Range(field string) *RangeAggregation

func (*SearchAggregation) ScriptedMetric

func (j *SearchAggregation) ScriptedMetric(field string) *ScriptedMetricAggregation

func (*SearchAggregation) Stats

func (j *SearchAggregation) Stats(field string) *StatsAggregation

func (*SearchAggregation) Sum

func (j *SearchAggregation) Sum(field string) *SumAggregation

func (*SearchAggregation) Term

func (j *SearchAggregation) Term(field string, v interface{}) *SearchAggregation

func (*SearchAggregation) Terms

func (j *SearchAggregation) Terms(field string) *TermsAggregation

func (*SearchAggregation) ValueCount

func (j *SearchAggregation) ValueCount(field string) *ValueCountAggregation

type SearchDsl

type SearchDsl struct {
	Json *simplejson.Json
	// contains filtered or unexported fields
}
func Search() *SearchDsl

the DSL search of usage:

s := NewServer("localhost", "9200")
Search().Index("plasticine").Type("user").From(1).Size(10).Query(
	QueryString().Query("star").Fields("name", "nickname"),
).Filter(
	Terms().Terms("age", "20"),
).Result(s)

func (*SearchDsl) Aggs

func (j *SearchDsl) Aggs(v ...interface{}) *SearchDsl

func (*SearchDsl) Encode

func (j *SearchDsl) Encode() []byte

func (*SearchDsl) Explain

func (j *SearchDsl) Explain(v bool) *SearchDsl

func (*SearchDsl) Facets

func (j *SearchDsl) Facets(v ...interface{}) *SearchDsl

func (*SearchDsl) FielddataFields

func (j *SearchDsl) FielddataFields(field ...string) *SearchDsl

func (*SearchDsl) Fields

func (j *SearchDsl) Fields(v ...interface{}) *SearchDsl

func (*SearchDsl) Filter

func (j *SearchDsl) Filter(v interface{}) *SearchDsl

func (*SearchDsl) From

func (j *SearchDsl) From(v interface{}) *SearchDsl

func (*SearchDsl) Highlight

func (j *SearchDsl) Highlight(v interface{}) *SearchDsl

func (*SearchDsl) Index

func (j *SearchDsl) Index(v ...string) *SearchDsl

func (*SearchDsl) IndicesBoost

func (j *SearchDsl) IndicesBoost(v ...interface{}) *SearchDsl

v is map[string]float64{"index1":1.2}

func (*SearchDsl) MinScore

func (j *SearchDsl) MinScore(v float64) *SearchDsl

func (*SearchDsl) PartialFields

func (j *SearchDsl) PartialFields(k string, v ...*simplejson.Json) *SearchDsl

func (*SearchDsl) PostFilter

func (j *SearchDsl) PostFilter(v interface{}) *SearchDsl

func (*SearchDsl) Preference

func (j *SearchDsl) Preference(v string) *SearchDsl

func (*SearchDsl) Query

func (j *SearchDsl) Query(v interface{}) *SearchDsl

func (*SearchDsl) Rescoring

func (j *SearchDsl) Rescoring(v ...interface{}) *SearchDsl

func (*SearchDsl) Result

func (j *SearchDsl) Result(s *Server) (*SearchResult, error)

func (*SearchDsl) ScriptFields

func (j *SearchDsl) ScriptFields(k string, v interface{}) *SearchDsl

func (*SearchDsl) Scroll

func (j *SearchDsl) Scroll(v string) *SearchDsl

func (*SearchDsl) SearchType

func (j *SearchDsl) SearchType(v string) *SearchDsl

func (*SearchDsl) Size

func (j *SearchDsl) Size(v interface{}) *SearchDsl

func (*SearchDsl) Sort

func (j *SearchDsl) Sort(v ...interface{}) *SearchDsl

func (*SearchDsl) Source

func (j *SearchDsl) Source(v ...interface{}) *SearchDsl

func (*SearchDsl) Type

func (j *SearchDsl) Type(v ...string) *SearchDsl

func (*SearchDsl) Version

func (j *SearchDsl) Version(v bool) *SearchDsl

type SearchFacet

type SearchFacet struct {
	Json *simplejson.Json `json:"facets"`
}

func Facets

func Facets() *SearchFacet

func (*SearchFacet) DateHistogram

func (j *SearchFacet) DateHistogram(field string) *DateHistogramFacets

func (*SearchFacet) Facets

func (j *SearchFacet) Facets(key string, val ...*SearchFacet) *SearchFacet

func (*SearchFacet) Filter

func (j *SearchFacet) Filter(field string, v interface{}) *SearchFacet

func (*SearchFacet) GeoDistance

func (j *SearchFacet) GeoDistance(field string) *GeoDistanceFacets

func (*SearchFacet) Histogram

func (j *SearchFacet) Histogram(field string) *HistogramFacets

func (*SearchFacet) Query

func (j *SearchFacet) Query(field string, v interface{}) *SearchFacet

func (*SearchFacet) Range

func (j *SearchFacet) Range(field string) *RangeFacets

func (*SearchFacet) Statistical

func (j *SearchFacet) Statistical(field string) *StatisticalFacets

func (*SearchFacet) Terms

func (j *SearchFacet) Terms(field string) *TermsFacets

func (*SearchFacet) TermsStats

func (j *SearchFacet) TermsStats(field string) *TermsStatsFacets

type SearchFilter

type SearchFilter struct {
	Json *simplejson.Json
}

func Filter

func Filter() *SearchFilter

func (*SearchFilter) Encode

func (j *SearchFilter) Encode() []byte

func (*SearchFilter) Filter

func (j *SearchFilter) Filter(v interface{}) *SearchFilter

type SearchHighlight

type SearchHighlight struct {
	Json *simplejson.Json `json:"highlight"`
	// contains filtered or unexported fields
}

func Highlight

func Highlight(field string) *SearchHighlight

func (*SearchHighlight) ForceSource

func (j *SearchHighlight) ForceSource(v bool) *SearchHighlight

func (*SearchHighlight) FragmentSize

func (j *SearchHighlight) FragmentSize(v int) *SearchHighlight

func (*SearchHighlight) HighlightQuery

func (j *SearchHighlight) HighlightQuery(v interface{}) *SearchHighlight

func (*SearchHighlight) MatchedFields

func (j *SearchHighlight) MatchedFields(v interface{}) *SearchHighlight

func (*SearchHighlight) NoMatchSize

func (j *SearchHighlight) NoMatchSize(v int) *SearchHighlight

func (*SearchHighlight) NumberOfFragments

func (j *SearchHighlight) NumberOfFragments(v int) *SearchHighlight

func (*SearchHighlight) Order

func (j *SearchHighlight) Order(v string) *SearchHighlight

func (*SearchHighlight) Tags

func (j *SearchHighlight) Tags(v ...string) *SearchHighlight

func (*SearchHighlight) Type

values are:plain, postings and fvh

type SearchRescore

type SearchRescore struct {
	Json *simplejson.Json `json:"rescore"`
}

func Rescoring

func Rescoring() *SearchRescore

func (*SearchRescore) QueryWeight

func (j *SearchRescore) QueryWeight(v float64) *SearchRescore

func (*SearchRescore) RescoreQuery

func (j *SearchRescore) RescoreQuery(v interface{}) *SearchRescore

func (*SearchRescore) RescoreQueryWeight

func (j *SearchRescore) RescoreQueryWeight(v float64) *SearchRescore

func (*SearchRescore) ScoreMode

func (j *SearchRescore) ScoreMode(v interface{}) *SearchRescore

func (*SearchRescore) WindowSize

func (j *SearchRescore) WindowSize(v interface{}) *SearchRescore

type SearchResult

type SearchResult struct {
	RawJSON      []byte
	Took         int             `json:"took"`
	TimedOut     bool            `json:"timed_out"`
	ShardStatus  Status          `json:"_shards"`
	Hits         Hits            `json:"hits"`
	Facets       json.RawMessage `json:"facets,omitempty"` // structure varies on query
	ScrollId     string          `json:"_scroll_id,omitempty"`
	Aggregations json.RawMessage `json:"aggregations,omitempty"` // structure varies on query
	Suggestions  Suggestions     `json:"suggest,omitempty"`
}

type Server

type Server struct {
	Hosts    []string
	Domain   string
	Port     string
	Protocol string

	DecayDuration time.Duration
	// contains filtered or unexported fields
}

func NewServer

func NewServer(host, port string) *Server

func (*Server) Cat

func (s *Server) Cat() *CatApi

func (*Server) ClusterReroute

func (s *Server) ClusterReroute(dry_run bool, v interface{}) (string, error)

usage

 s := plasticine.NewServer("localhost", "9200")
	str, err := s.ClusterReroute(true,
		plasticine.Commands(
			plasticine.Command(plasticine.Move().Index("test1").Shard(1).FromNode("node1").ToNode("node2")),
			plasticine.Command(plasticine.Allocate().Index("test2").Shard(0).Node("ad").AllowPrimary(false)),
		))
	fmt.Println(str, err)

func (*Server) Debug

func (s *Server) Debug(flag bool)

func (*Server) Delete

func (s *Server) Delete(index string, _type string, id string, args map[string]interface{}) (*BaseResponse, error)

func (*Server) DeleteByQuery

func (s *Server) DeleteByQuery(index string, _type string, id string, args map[string]interface{}) (*BaseResponse, error)

func (*Server) Get

func (s *Server) Get(index string, _type string, id string, args map[string]interface{}) (*BaseResponse, error)

Get

func (*Server) GetClusterHealth

func (s *Server) GetClusterHealth(indices ...string) (ClusterHealth, error)

func (*Server) GetClusterPendingTasks

func (s *Server) GetClusterPendingTasks() (PendingTasks, error)

func (*Server) GetClusterState

func (s *Server) GetClusterState() (ClusterState, error)

func (*Server) GetClusterStats

func (s *Server) GetClusterStats() (ClusterStats, error)

func (*Server) GetNodeInfo

func (s *Server) GetNodeInfo(para []string, nodes ...string) (NodeStats, error)

func (*Server) GetNodeStats

func (s *Server) GetNodeStats(para []string, nodes ...string) (NodeStats, error)

func (*Server) GetSource

func (s *Server) GetSource(index string, _type string, id string, args map[string]interface{}, source interface{}) error

GetSource retrieves the document by id and converts it to provided interface

func (*Server) Index

func (s *Server) Index(index string, _type string, id string, args map[string]interface{}, data interface{}) (*BaseResponse, error)

default put method

func (*Server) IndexOfPost

func (s *Server) IndexOfPost(index string, _type string, args map[string]interface{}, data interface{}) (*BaseResponse, error)

func (*Server) Indices

func (s *Server) Indices() *IndicesApi

func (*Server) MultiGet

func (s *Server) MultiGet(index string, _type string, id string, args map[string]interface{}) ([]BaseResponse, error)

Multi GET API

func (*Server) Search

func (s *Server) Search(index string, _type string, args map[string]interface{}, data interface{}) (*SearchResult, error)

func (*Server) SearchByJson

func (s *Server) SearchByJson(index string, _type string, json Jsoner) (*SearchResult, error)

func (*Server) SetHosts

func (s *Server) SetHosts(hosts []string)

func (*Server) ShutDownNode

func (s *Server) ShutDownNode(delay int, nodes ...string) (string, error)

func (*Server) UpdateClusterSettings

func (s *Server) UpdateClusterSettings(transient, persistent map[string]int) (ClusterSettings, error)

func (*Server) UpdateDocument

func (s *Server) UpdateDocument(index string, _type string, id string, args map[string]interface{}, data interface{}) (*BaseResponse, error)

func (*Server) UpdateScript

func (s *Server) UpdateScript(index string, _type string, id string, args map[string]interface{}, data interface{}) (*BaseResponse, error)

type SimpleQueryStringQuery

type SimpleQueryStringQuery struct {
	Json *simplejson.Json `json:"simple_query_string"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html

func SimpleQueryString

func SimpleQueryString() *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) Analyzer

func (j *SimpleQueryStringQuery) Analyzer(v interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) Boost

func (j *SimpleQueryStringQuery) Boost(v interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) DefaultOperator

func (j *SimpleQueryStringQuery) DefaultOperator(v interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) Encode

func (j *SimpleQueryStringQuery) Encode() []byte

func (*SimpleQueryStringQuery) Fields

func (j *SimpleQueryStringQuery) Fields(v ...interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) Flags

func (j *SimpleQueryStringQuery) Flags(v interface{}) *SimpleQueryStringQuery

The available flags are: ALL, NONE, AND, OR, NOT, PREFIX, PHRASE, PRECEDENCE, ESCAPE, WHITESPACE, FUZZY, NEAR, and SLOP

func (*SimpleQueryStringQuery) Lenient

func (j *SimpleQueryStringQuery) Lenient(v interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) Locale

func (j *SimpleQueryStringQuery) Locale(v interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) LowercaseExpandedTerms

func (j *SimpleQueryStringQuery) LowercaseExpandedTerms(v interface{}) *SimpleQueryStringQuery

func (*SimpleQueryStringQuery) Query

func (j *SimpleQueryStringQuery) Query(v interface{}) *SimpleQueryStringQuery

type SpanFirstQuery

type SpanFirstQuery struct {
	Json *simplejson.Json `json:"span_first"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-span-first-query.html

func SpanFirst

func SpanFirst() *SpanFirstQuery

func (*SpanFirstQuery) Encode

func (j *SpanFirstQuery) Encode() []byte

func (*SpanFirstQuery) End

func (j *SpanFirstQuery) End(v int) *SpanFirstQuery

func (*SpanFirstQuery) Match

func (j *SpanFirstQuery) Match(k, v string) *SpanFirstQuery

type SpanMultiQuery

type SpanMultiQuery struct {
	Json *simplejson.Json `json:"span_multi"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-span-multi-term-query.html

func SpanMulti

func SpanMulti() *SpanMultiQuery

func (*SpanMultiQuery) Encode

func (j *SpanMultiQuery) Encode() []byte

func (*SpanMultiQuery) Match

func (j *SpanMultiQuery) Match(v interface{}) *SpanMultiQuery

type SpanNearQuery

type SpanNearQuery struct {
	Json *simplejson.Json `json:"span_near"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-span-near-query.html

func SpanNear

func SpanNear() *SpanNearQuery

func (*SpanNearQuery) Clauses

func (j *SpanNearQuery) Clauses(v ...interface{}) *SpanNearQuery

func (*SpanNearQuery) CollectPayloads

func (j *SpanNearQuery) CollectPayloads(v bool) *SpanNearQuery

func (*SpanNearQuery) Encode

func (j *SpanNearQuery) Encode() []byte

func (*SpanNearQuery) InOrder

func (j *SpanNearQuery) InOrder(v bool) *SpanNearQuery

func (*SpanNearQuery) Slop

func (j *SpanNearQuery) Slop(v interface{}) *SpanNearQuery

type SpanNotQuery

type SpanNotQuery struct {
	Json *simplejson.Json `json:"span_not"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-span-not-query.html

func SpanNot

func SpanNot() *SpanNotQuery

func (*SpanNotQuery) Dist

func (j *SpanNotQuery) Dist(v interface{}) *SpanNotQuery

func (*SpanNotQuery) Encode

func (j *SpanNotQuery) Encode() []byte

func (*SpanNotQuery) Exclude

func (j *SpanNotQuery) Exclude(v interface{}) *SpanNotQuery

func (*SpanNotQuery) Include

func (j *SpanNotQuery) Include(v interface{}) *SpanNotQuery

func (*SpanNotQuery) Post

func (j *SpanNotQuery) Post(v interface{}) *SpanNotQuery

func (*SpanNotQuery) Pre

func (j *SpanNotQuery) Pre(v interface{}) *SpanNotQuery

type SpanOrQuery

type SpanOrQuery struct {
	Json *simplejson.Json `json:"span_or"`
}

func SpanOr

func SpanOr() *SpanOrQuery

func (*SpanOrQuery) Clauses

func (j *SpanOrQuery) Clauses(v ...interface{}) *SpanOrQuery

func (*SpanOrQuery) Encode

func (j *SpanOrQuery) Encode() []byte

type SpanTermQuery

type SpanTermQuery struct {
	Json *simplejson.Json `json:"span_term"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-span-term-query.html

func SpanTerm

func SpanTerm(field string) *SpanTermQuery

func (*SpanTermQuery) Boost

func (j *SpanTermQuery) Boost(v interface{}) *SpanTermQuery

func (*SpanTermQuery) Encode

func (j *SpanTermQuery) Encode() []byte

func (*SpanTermQuery) Term

func (j *SpanTermQuery) Term(v interface{}) *SpanTermQuery

func (*SpanTermQuery) Val

func (j *SpanTermQuery) Val(v interface{}) *SpanTermQuery

func (*SpanTermQuery) Value

func (j *SpanTermQuery) Value(v interface{}) *SpanTermQuery

type StatisticalFacets

type StatisticalFacets struct {
	Json *simplejson.Json `json:"statistical"`
	// contains filtered or unexported fields
}

func (*StatisticalFacets) Facet

func (j *StatisticalFacets) Facet() *SearchFacet

func (*StatisticalFacets) Field

func (j *StatisticalFacets) Field(v ...string) *StatisticalFacets

func (*StatisticalFacets) Params

func (j *StatisticalFacets) Params(v map[string]interface{}) *StatisticalFacets

type StatsAggregation

type StatsAggregation struct {
	Json *simplejson.Json `json:"stats"`
	// contains filtered or unexported fields
}

func (*StatsAggregation) Aggs

func (*StatsAggregation) Field

func (j *StatsAggregation) Field(field string) *StatsAggregation

func (*StatsAggregation) Params

func (j *StatsAggregation) Params(k string, v interface{}) *StatsAggregation

func (*StatsAggregation) Script

type Status

type Status struct {
	Total      StatusInt `json:"total"`
	Successful StatusInt `json:"successful"`
	Failed     StatusInt `json:"failed"`
	Failures   []Failure `json:"failures,omitempty"`
}

type StatusBool

type StatusBool bool

StatusBool is required because /_optimize, at least, returns its status as strings instead of booleans.

func (*StatusBool) MarshalJSON

func (self *StatusBool) MarshalJSON() ([]byte, error)

func (*StatusBool) UnmarshalJSON

func (self *StatusBool) UnmarshalJSON(b []byte) error

type StatusInt

type StatusInt int

StatusInt is required because /_optimize, at least, returns its status as strings instead of integers.

func (*StatusInt) MarshalJSON

func (self *StatusInt) MarshalJSON() ([]byte, error)

func (*StatusInt) UnmarshalJSON

func (self *StatusInt) UnmarshalJSON(b []byte) error

type Suggestion

type Suggestion struct {
	Length  int                `json:"length"`
	Offset  int                `json:"offset"`
	Options []SuggestionOption `json:"options"`
	Text    string             `json:"text"`
}

type SuggestionOption

type SuggestionOption struct {
	Payload json.RawMessage `json:"payload"`
	//Score   Float64Nullable `json:"score,omitempty"`
	Score float64 `json:"score,omitempty"`
	Text  string  `json:"text"`
}

type Suggestions

type Suggestions map[string][]Suggestion

type SumAggregation

type SumAggregation struct {
	Json *simplejson.Json `json:"sum"`
	// contains filtered or unexported fields
}

func (*SumAggregation) Aggs

func (j *SumAggregation) Aggs() *SearchAggregation

func (*SumAggregation) Field

func (j *SumAggregation) Field(field string) *SumAggregation

func (*SumAggregation) Params

func (j *SumAggregation) Params(k string, v interface{}) *SumAggregation

func (*SumAggregation) Script

func (j *SumAggregation) Script(v string) *SumAggregation

type Task

type Task struct {
	InsertOrder       int    `json:"insert_order"`
	Priority          string `json:"priority"`
	Source            string `json:"source"`
	TimeInQueueMillis int    `json:"time_in_queue_millis"`
	TimeInQueue       string `json:"time_in_queue"`
}

type TemplateQuery

type TemplateQuery struct {
	Json *simplejson.Json `json:"template"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-template-query.html

func Template

func Template() *TemplateQuery

func (*TemplateQuery) Encode

func (j *TemplateQuery) Encode() []byte

func (*TemplateQuery) Params

func (j *TemplateQuery) Params(k string, v interface{}) *TemplateQuery

func (*TemplateQuery) Query

func (j *TemplateQuery) Query(v interface{}) *TemplateQuery

func (*TemplateQuery) QueryMap

func (j *TemplateQuery) QueryMap(k string, v interface{}) *TemplateQuery

struct{}{}

type TermQuery

type TermQuery struct {
	Json *simplejson.Json `json:"term"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-query.html

func Term

func Term(field string) *TermQuery

func (*TermQuery) Boost

func (j *TermQuery) Boost(v interface{}) *TermQuery

func (*TermQuery) Cache

func (j *TermQuery) Cache(v bool) *TermQuery

func (*TermQuery) Encode

func (j *TermQuery) Encode() []byte

func (*TermQuery) Term

func (j *TermQuery) Term(v interface{}) *TermQuery

func (*TermQuery) Val

func (j *TermQuery) Val(v interface{}) *TermQuery

func (*TermQuery) Value

func (j *TermQuery) Value(v interface{}) *TermQuery

type TermsAggregation

type TermsAggregation struct {
	Json *simplejson.Json `json:"terms"`
	// contains filtered or unexported fields
}

func (*TermsAggregation) Aggs

func (*TermsAggregation) CollectMode

func (j *TermsAggregation) CollectMode(v string) *TermsAggregation

func (*TermsAggregation) Exclude

func (j *TermsAggregation) Exclude(v interface{}) *TermsAggregation

func (*TermsAggregation) ExecutionHint

func (j *TermsAggregation) ExecutionHint(v string) *TermsAggregation

func (*TermsAggregation) Field

func (*TermsAggregation) Include

func (j *TermsAggregation) Include(v interface{}) *TermsAggregation

func (*TermsAggregation) MinDocCount

func (j *TermsAggregation) MinDocCount(v int) *TermsAggregation

func (*TermsAggregation) Order

func (*TermsAggregation) Script

func (*TermsAggregation) Size

type TermsFacets

type TermsFacets struct {
	Json *simplejson.Json `json:"terms"`
	// contains filtered or unexported fields
}

func (*TermsFacets) AllTerms

func (j *TermsFacets) AllTerms(v bool) *TermsFacets

func (*TermsFacets) Exclude

func (j *TermsFacets) Exclude(v ...string) *TermsFacets

func (*TermsFacets) Facet

func (j *TermsFacets) Facet() *SearchFacet

func (*TermsFacets) Field

func (j *TermsFacets) Field(v ...string) *TermsFacets

func (*TermsFacets) Index

func (j *TermsFacets) Index(v string) *TermsFacets

func (*TermsFacets) Order

func (j *TermsFacets) Order(v string) *TermsFacets

func (*TermsFacets) Regex

func (j *TermsFacets) Regex(v string) *TermsFacets

func (*TermsFacets) RegexFlags

func (j *TermsFacets) RegexFlags(v string) *TermsFacets

func (*TermsFacets) Script

func (j *TermsFacets) Script(v string) *TermsFacets

func (*TermsFacets) ScriptField

func (j *TermsFacets) ScriptField(v string) *TermsFacets

func (*TermsFacets) Size

func (j *TermsFacets) Size(v int) *TermsFacets

type TermsQuery

type TermsQuery struct {
	Json *simplejson.Json `json:"terms"`
}

func Terms

func Terms() *TermsQuery

func (*TermsQuery) Cache

func (j *TermsQuery) Cache(v bool) *TermsQuery

func (*TermsQuery) Encode

func (j *TermsQuery) Encode() []byte

func (*TermsQuery) Execution

func (j *TermsQuery) Execution(v string) *TermsQuery

func (*TermsQuery) MinimumShouldMatch

func (j *TermsQuery) MinimumShouldMatch(v interface{}) *TermsQuery

func (*TermsQuery) Tags

func (j *TermsQuery) Tags(v ...interface{}) *TermsQuery

func (*TermsQuery) Terms

func (j *TermsQuery) Terms(k string, v ...interface{}) *TermsQuery

type TermsStatsFacets

type TermsStatsFacets struct {
	Json *simplejson.Json `json:"terms_stats"`
	// contains filtered or unexported fields
}

func (*TermsStatsFacets) Facet

func (j *TermsStatsFacets) Facet() *SearchFacet

func (*TermsStatsFacets) KeyField

func (j *TermsStatsFacets) KeyField(v string) *TermsStatsFacets

func (*TermsStatsFacets) Lang

func (*TermsStatsFacets) Order

func (*TermsStatsFacets) Params

func (j *TermsStatsFacets) Params(v map[string]interface{}) *TermsStatsFacets

func (*TermsStatsFacets) Script

func (*TermsStatsFacets) ShardSize

func (j *TermsStatsFacets) ShardSize(v int) *TermsStatsFacets

func (*TermsStatsFacets) Size

func (*TermsStatsFacets) ValueField

func (j *TermsStatsFacets) ValueField(v string) *TermsStatsFacets

type TopChildrenQuery

type TopChildrenQuery struct {
	Json *simplejson.Json `json:"top_children"`
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-top-children-query.html

func TopChildren

func TopChildren() *TopChildrenQuery

func (*TopChildrenQuery) Encode

func (j *TopChildrenQuery) Encode() []byte

func (*TopChildrenQuery) Factor

func (j *TopChildrenQuery) Factor(v interface{}) *TopChildrenQuery

func (*TopChildrenQuery) IncrementalFactor

func (j *TopChildrenQuery) IncrementalFactor(v interface{}) *TopChildrenQuery

func (*TopChildrenQuery) Query

func (j *TopChildrenQuery) Query(v interface{}) *TopChildrenQuery

func (*TopChildrenQuery) Scope

func (j *TopChildrenQuery) Scope(v interface{}) *TopChildrenQuery

func (*TopChildrenQuery) Score

func (j *TopChildrenQuery) Score(v interface{}) *TopChildrenQuery

func (*TopChildrenQuery) Type

func (j *TopChildrenQuery) Type(v interface{}) *TopChildrenQuery

type ValueCountAggregation

type ValueCountAggregation struct {
	Json *simplejson.Json `json:"value_count"`
	// contains filtered or unexported fields
}

func (*ValueCountAggregation) Aggs

func (*ValueCountAggregation) Field

func (*ValueCountAggregation) Script

type WildcardQuery

type WildcardQuery struct {
	Json *simplejson.Json `json:"wildcard"`
	// contains filtered or unexported fields
}

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html

func Wildcard

func Wildcard(field string) *WildcardQuery

func (*WildcardQuery) Boost

func (j *WildcardQuery) Boost(v interface{}) *WildcardQuery

func (*WildcardQuery) Encode

func (j *WildcardQuery) Encode() []byte

func (*WildcardQuery) Val

func (j *WildcardQuery) Val(v interface{}) *WildcardQuery

func (*WildcardQuery) Value

func (j *WildcardQuery) Value(v interface{}) *WildcardQuery

func (*WildcardQuery) Wildcard

func (j *WildcardQuery) Wildcard(v interface{}) *WildcardQuery

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL