1 Star 1 Fork 0

宇宙蒙面侠X/github.com-olivere-elastic

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
search_filters_type.go 868 Bytes
Copy Edit Raw Blame History
// Copyright 2012-2015 Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
// Filters documents matching the provided document / mapping type.
// Note, this filter can work even when the _type field is not indexed
// (using the _uid field).
// For details, see:
// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-type-filter.html
type TypeFilter struct {
Filter
typ string
}
func NewTypeFilter(typ string) TypeFilter {
f := TypeFilter{typ: typ}
return f
}
func (f TypeFilter) Source() interface{} {
// {
// "type" : {
// "value" : "..."
// }
// }
source := make(map[string]interface{})
params := make(map[string]interface{})
source["type"] = params
params["value"] = f.typ
return source
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/awol2010ex/github.com-olivere-elastic.git
git@gitee.com:awol2010ex/github.com-olivere-elastic.git
awol2010ex
github.com-olivere-elastic
github.com-olivere-elastic
v2.0.31

Search

344bd9b3 5694891 D2dac590 5694891