repo
stringlengths 5
54
| path
stringlengths 4
155
| func_name
stringlengths 1
118
| original_string
stringlengths 52
85.5k
| language
stringclasses 1
value | code
stringlengths 52
85.5k
| code_tokens
sequence | docstring
stringlengths 6
2.61k
| docstring_tokens
sequence | sha
stringlengths 40
40
| url
stringlengths 85
252
| partition
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|
olivere/elastic | client.go | mustActiveConn | func (c *Client) mustActiveConn() error {
c.connsMu.Lock()
defer c.connsMu.Unlock()
for _, c := range c.conns {
if !c.IsDead() {
return nil
}
}
return errors.Wrap(ErrNoClient, "no active connection found")
} | go | func (c *Client) mustActiveConn() error {
c.connsMu.Lock()
defer c.connsMu.Unlock()
for _, c := range c.conns {
if !c.IsDead() {
return nil
}
}
return errors.Wrap(ErrNoClient, "no active connection found")
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"mustActiveConn",
"(",
")",
"error",
"{",
"c",
".",
"connsMu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"connsMu",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"_",
",",
"c",
":=",
"range",
"c",
".",
"conns",
"{",
"if",
"!",
"c",
".",
"IsDead",
"(",
")",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"errors",
".",
"Wrap",
"(",
"ErrNoClient",
",",
"\"",
"\"",
")",
"\n",
"}"
] | // mustActiveConn returns nil if there is an active connection,
// otherwise ErrNoClient is returned. | [
"mustActiveConn",
"returns",
"nil",
"if",
"there",
"is",
"an",
"active",
"connection",
"otherwise",
"ErrNoClient",
"is",
"returned",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1217-L1227 | train |
olivere/elastic | client.go | DeleteByQuery | func (c *Client) DeleteByQuery(indices ...string) *DeleteByQueryService {
return NewDeleteByQueryService(c).Index(indices...)
} | go | func (c *Client) DeleteByQuery(indices ...string) *DeleteByQueryService {
return NewDeleteByQueryService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteByQuery",
"(",
"indices",
"...",
"string",
")",
"*",
"DeleteByQueryService",
"{",
"return",
"NewDeleteByQueryService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // DeleteByQuery deletes documents as found by a query. | [
"DeleteByQuery",
"deletes",
"documents",
"as",
"found",
"by",
"a",
"query",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1433-L1435 | train |
olivere/elastic | client.go | UpdateByQuery | func (c *Client) UpdateByQuery(indices ...string) *UpdateByQueryService {
return NewUpdateByQueryService(c).Index(indices...)
} | go | func (c *Client) UpdateByQuery(indices ...string) *UpdateByQueryService {
return NewUpdateByQueryService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateByQuery",
"(",
"indices",
"...",
"string",
")",
"*",
"UpdateByQueryService",
"{",
"return",
"NewUpdateByQueryService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // UpdateByQuery performs an update on a set of documents. | [
"UpdateByQuery",
"performs",
"an",
"update",
"on",
"a",
"set",
"of",
"documents",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1443-L1445 | train |
olivere/elastic | client.go | TermVectors | func (c *Client) TermVectors(index, typ string) *TermvectorsService {
builder := NewTermvectorsService(c)
builder = builder.Index(index).Type(typ)
return builder
} | go | func (c *Client) TermVectors(index, typ string) *TermvectorsService {
builder := NewTermvectorsService(c)
builder = builder.Index(index).Type(typ)
return builder
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"TermVectors",
"(",
"index",
",",
"typ",
"string",
")",
"*",
"TermvectorsService",
"{",
"builder",
":=",
"NewTermvectorsService",
"(",
"c",
")",
"\n",
"builder",
"=",
"builder",
".",
"Index",
"(",
"index",
")",
".",
"Type",
"(",
"typ",
")",
"\n",
"return",
"builder",
"\n",
"}"
] | // TermVectors returns information and statistics on terms in the fields
// of a particular document. | [
"TermVectors",
"returns",
"information",
"and",
"statistics",
"on",
"terms",
"in",
"the",
"fields",
"of",
"a",
"particular",
"document",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1467-L1471 | train |
olivere/elastic | client.go | Explain | func (c *Client) Explain(index, typ, id string) *ExplainService {
return NewExplainService(c).Index(index).Type(typ).Id(id)
} | go | func (c *Client) Explain(index, typ, id string) *ExplainService {
return NewExplainService(c).Index(index).Type(typ).Id(id)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Explain",
"(",
"index",
",",
"typ",
",",
"id",
"string",
")",
"*",
"ExplainService",
"{",
"return",
"NewExplainService",
"(",
"c",
")",
".",
"Index",
"(",
"index",
")",
".",
"Type",
"(",
"typ",
")",
".",
"Id",
"(",
"id",
")",
"\n",
"}"
] | // Explain computes a score explanation for a query and a specific document. | [
"Explain",
"computes",
"a",
"score",
"explanation",
"for",
"a",
"query",
"and",
"a",
"specific",
"document",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1497-L1499 | train |
olivere/elastic | client.go | SearchShards | func (c *Client) SearchShards(indices ...string) *SearchShardsService {
return NewSearchShardsService(c).Index(indices...)
} | go | func (c *Client) SearchShards(indices ...string) *SearchShardsService {
return NewSearchShardsService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SearchShards",
"(",
"indices",
"...",
"string",
")",
"*",
"SearchShardsService",
"{",
"return",
"NewSearchShardsService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // SearchShards returns statistical information about nodes and shards. | [
"SearchShards",
"returns",
"statistical",
"information",
"about",
"nodes",
"and",
"shards",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1510-L1512 | train |
olivere/elastic | client.go | FieldCaps | func (c *Client) FieldCaps(indices ...string) *FieldCapsService {
return NewFieldCapsService(c).Index(indices...)
} | go | func (c *Client) FieldCaps(indices ...string) *FieldCapsService {
return NewFieldCapsService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"FieldCaps",
"(",
"indices",
"...",
"string",
")",
"*",
"FieldCapsService",
"{",
"return",
"NewFieldCapsService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // FieldCaps returns statistical information about fields in indices. | [
"FieldCaps",
"returns",
"statistical",
"information",
"about",
"fields",
"in",
"indices",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1515-L1517 | train |
olivere/elastic | client.go | Scroll | func (c *Client) Scroll(indices ...string) *ScrollService {
return NewScrollService(c).Index(indices...)
} | go | func (c *Client) Scroll(indices ...string) *ScrollService {
return NewScrollService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Scroll",
"(",
"indices",
"...",
"string",
")",
"*",
"ScrollService",
"{",
"return",
"NewScrollService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // Scroll through documents. Use this to efficiently scroll through results
// while returning the results to a client. | [
"Scroll",
"through",
"documents",
".",
"Use",
"this",
"to",
"efficiently",
"scroll",
"through",
"results",
"while",
"returning",
"the",
"results",
"to",
"a",
"client",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1526-L1528 | train |
olivere/elastic | client.go | ClearScroll | func (c *Client) ClearScroll(scrollIds ...string) *ClearScrollService {
return NewClearScrollService(c).ScrollId(scrollIds...)
} | go | func (c *Client) ClearScroll(scrollIds ...string) *ClearScrollService {
return NewClearScrollService(c).ScrollId(scrollIds...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ClearScroll",
"(",
"scrollIds",
"...",
"string",
")",
"*",
"ClearScrollService",
"{",
"return",
"NewClearScrollService",
"(",
"c",
")",
".",
"ScrollId",
"(",
"scrollIds",
"...",
")",
"\n",
"}"
] | // ClearScroll can be used to clear search contexts manually. | [
"ClearScroll",
"can",
"be",
"used",
"to",
"clear",
"search",
"contexts",
"manually",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1531-L1533 | train |
olivere/elastic | client.go | ShrinkIndex | func (c *Client) ShrinkIndex(source, target string) *IndicesShrinkService {
return NewIndicesShrinkService(c).Source(source).Target(target)
} | go | func (c *Client) ShrinkIndex(source, target string) *IndicesShrinkService {
return NewIndicesShrinkService(c).Source(source).Target(target)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ShrinkIndex",
"(",
"source",
",",
"target",
"string",
")",
"*",
"IndicesShrinkService",
"{",
"return",
"NewIndicesShrinkService",
"(",
"c",
")",
".",
"Source",
"(",
"source",
")",
".",
"Target",
"(",
"target",
")",
"\n",
"}"
] | // ShrinkIndex returns a service to shrink one index into another. | [
"ShrinkIndex",
"returns",
"a",
"service",
"to",
"shrink",
"one",
"index",
"into",
"another",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1553-L1555 | train |
olivere/elastic | client.go | RolloverIndex | func (c *Client) RolloverIndex(alias string) *IndicesRolloverService {
return NewIndicesRolloverService(c).Alias(alias)
} | go | func (c *Client) RolloverIndex(alias string) *IndicesRolloverService {
return NewIndicesRolloverService(c).Alias(alias)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"RolloverIndex",
"(",
"alias",
"string",
")",
"*",
"IndicesRolloverService",
"{",
"return",
"NewIndicesRolloverService",
"(",
"c",
")",
".",
"Alias",
"(",
"alias",
")",
"\n",
"}"
] | // RolloverIndex rolls an alias over to a new index when the existing index
// is considered to be too large or too old. | [
"RolloverIndex",
"rolls",
"an",
"alias",
"over",
"to",
"a",
"new",
"index",
"when",
"the",
"existing",
"index",
"is",
"considered",
"to",
"be",
"too",
"large",
"or",
"too",
"old",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1559-L1561 | train |
olivere/elastic | client.go | IndexStats | func (c *Client) IndexStats(indices ...string) *IndicesStatsService {
return NewIndicesStatsService(c).Index(indices...)
} | go | func (c *Client) IndexStats(indices ...string) *IndicesStatsService {
return NewIndicesStatsService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexStats",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesStatsService",
"{",
"return",
"NewIndicesStatsService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // IndexStats provides statistics on different operations happining
// in one or more indices. | [
"IndexStats",
"provides",
"statistics",
"on",
"different",
"operations",
"happining",
"in",
"one",
"or",
"more",
"indices",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1565-L1567 | train |
olivere/elastic | client.go | FreezeIndex | func (c *Client) FreezeIndex(name string) *IndicesFreezeService {
return NewIndicesFreezeService(c).Index(name)
} | go | func (c *Client) FreezeIndex(name string) *IndicesFreezeService {
return NewIndicesFreezeService(c).Index(name)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"FreezeIndex",
"(",
"name",
"string",
")",
"*",
"IndicesFreezeService",
"{",
"return",
"NewIndicesFreezeService",
"(",
"c",
")",
".",
"Index",
"(",
"name",
")",
"\n",
"}"
] | // FreezeIndex freezes an index. | [
"FreezeIndex",
"freezes",
"an",
"index",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1580-L1582 | train |
olivere/elastic | client.go | UnfreezeIndex | func (c *Client) UnfreezeIndex(name string) *IndicesUnfreezeService {
return NewIndicesUnfreezeService(c).Index(name)
} | go | func (c *Client) UnfreezeIndex(name string) *IndicesUnfreezeService {
return NewIndicesUnfreezeService(c).Index(name)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UnfreezeIndex",
"(",
"name",
"string",
")",
"*",
"IndicesUnfreezeService",
"{",
"return",
"NewIndicesUnfreezeService",
"(",
"c",
")",
".",
"Index",
"(",
"name",
")",
"\n",
"}"
] | // UnfreezeIndex unfreezes an index. | [
"UnfreezeIndex",
"unfreezes",
"an",
"index",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1585-L1587 | train |
olivere/elastic | client.go | IndexGet | func (c *Client) IndexGet(indices ...string) *IndicesGetService {
return NewIndicesGetService(c).Index(indices...)
} | go | func (c *Client) IndexGet(indices ...string) *IndicesGetService {
return NewIndicesGetService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexGet",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesGetService",
"{",
"return",
"NewIndicesGetService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // IndexGet retrieves information about one or more indices.
// IndexGet is only available for Elasticsearch 1.4 or later. | [
"IndexGet",
"retrieves",
"information",
"about",
"one",
"or",
"more",
"indices",
".",
"IndexGet",
"is",
"only",
"available",
"for",
"Elasticsearch",
"1",
".",
"4",
"or",
"later",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1591-L1593 | train |
olivere/elastic | client.go | IndexGetSettings | func (c *Client) IndexGetSettings(indices ...string) *IndicesGetSettingsService {
return NewIndicesGetSettingsService(c).Index(indices...)
} | go | func (c *Client) IndexGetSettings(indices ...string) *IndicesGetSettingsService {
return NewIndicesGetSettingsService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexGetSettings",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesGetSettingsService",
"{",
"return",
"NewIndicesGetSettingsService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // IndexGetSettings retrieves settings of all, one or more indices. | [
"IndexGetSettings",
"retrieves",
"settings",
"of",
"all",
"one",
"or",
"more",
"indices",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1596-L1598 | train |
olivere/elastic | client.go | IndexPutSettings | func (c *Client) IndexPutSettings(indices ...string) *IndicesPutSettingsService {
return NewIndicesPutSettingsService(c).Index(indices...)
} | go | func (c *Client) IndexPutSettings(indices ...string) *IndicesPutSettingsService {
return NewIndicesPutSettingsService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexPutSettings",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesPutSettingsService",
"{",
"return",
"NewIndicesPutSettingsService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // IndexPutSettings sets settings for all, one or more indices. | [
"IndexPutSettings",
"sets",
"settings",
"for",
"all",
"one",
"or",
"more",
"indices",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1601-L1603 | train |
olivere/elastic | client.go | IndexSegments | func (c *Client) IndexSegments(indices ...string) *IndicesSegmentsService {
return NewIndicesSegmentsService(c).Index(indices...)
} | go | func (c *Client) IndexSegments(indices ...string) *IndicesSegmentsService {
return NewIndicesSegmentsService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexSegments",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesSegmentsService",
"{",
"return",
"NewIndicesSegmentsService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // IndexSegments retrieves low level segment information for all, one or more indices. | [
"IndexSegments",
"retrieves",
"low",
"level",
"segment",
"information",
"for",
"all",
"one",
"or",
"more",
"indices",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1606-L1608 | train |
olivere/elastic | client.go | Forcemerge | func (c *Client) Forcemerge(indices ...string) *IndicesForcemergeService {
return NewIndicesForcemergeService(c).Index(indices...)
} | go | func (c *Client) Forcemerge(indices ...string) *IndicesForcemergeService {
return NewIndicesForcemergeService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Forcemerge",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesForcemergeService",
"{",
"return",
"NewIndicesForcemergeService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // Forcemerge optimizes one or more indices.
// It replaces the deprecated Optimize API. | [
"Forcemerge",
"optimizes",
"one",
"or",
"more",
"indices",
".",
"It",
"replaces",
"the",
"deprecated",
"Optimize",
"API",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1618-L1620 | train |
olivere/elastic | client.go | Flush | func (c *Client) Flush(indices ...string) *IndicesFlushService {
return NewIndicesFlushService(c).Index(indices...)
} | go | func (c *Client) Flush(indices ...string) *IndicesFlushService {
return NewIndicesFlushService(c).Index(indices...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Flush",
"(",
"indices",
"...",
"string",
")",
"*",
"IndicesFlushService",
"{",
"return",
"NewIndicesFlushService",
"(",
"c",
")",
".",
"Index",
"(",
"indices",
"...",
")",
"\n",
"}"
] | // Flush asks Elasticsearch to free memory from the index and
// flush data to disk. | [
"Flush",
"asks",
"Elasticsearch",
"to",
"free",
"memory",
"from",
"the",
"index",
"and",
"flush",
"data",
"to",
"disk",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1629-L1631 | train |
olivere/elastic | client.go | IndexGetTemplate | func (c *Client) IndexGetTemplate(names ...string) *IndicesGetTemplateService {
return NewIndicesGetTemplateService(c).Name(names...)
} | go | func (c *Client) IndexGetTemplate(names ...string) *IndicesGetTemplateService {
return NewIndicesGetTemplateService(c).Name(names...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexGetTemplate",
"(",
"names",
"...",
"string",
")",
"*",
"IndicesGetTemplateService",
"{",
"return",
"NewIndicesGetTemplateService",
"(",
"c",
")",
".",
"Name",
"(",
"names",
"...",
")",
"\n",
"}"
] | // IndexGetTemplate gets an index template.
// Use XXXTemplate funcs to manage search templates. | [
"IndexGetTemplate",
"gets",
"an",
"index",
"template",
".",
"Use",
"XXXTemplate",
"funcs",
"to",
"manage",
"search",
"templates",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1654-L1656 | train |
olivere/elastic | client.go | IndexTemplateExists | func (c *Client) IndexTemplateExists(name string) *IndicesExistsTemplateService {
return NewIndicesExistsTemplateService(c).Name(name)
} | go | func (c *Client) IndexTemplateExists(name string) *IndicesExistsTemplateService {
return NewIndicesExistsTemplateService(c).Name(name)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexTemplateExists",
"(",
"name",
"string",
")",
"*",
"IndicesExistsTemplateService",
"{",
"return",
"NewIndicesExistsTemplateService",
"(",
"c",
")",
".",
"Name",
"(",
"name",
")",
"\n",
"}"
] | // IndexTemplateExists gets check if an index template exists.
// Use XXXTemplate funcs to manage search templates. | [
"IndexTemplateExists",
"gets",
"check",
"if",
"an",
"index",
"template",
"exists",
".",
"Use",
"XXXTemplate",
"funcs",
"to",
"manage",
"search",
"templates",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1660-L1662 | train |
olivere/elastic | client.go | IndexPutTemplate | func (c *Client) IndexPutTemplate(name string) *IndicesPutTemplateService {
return NewIndicesPutTemplateService(c).Name(name)
} | go | func (c *Client) IndexPutTemplate(name string) *IndicesPutTemplateService {
return NewIndicesPutTemplateService(c).Name(name)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexPutTemplate",
"(",
"name",
"string",
")",
"*",
"IndicesPutTemplateService",
"{",
"return",
"NewIndicesPutTemplateService",
"(",
"c",
")",
".",
"Name",
"(",
"name",
")",
"\n",
"}"
] | // IndexPutTemplate creates or updates an index template.
// Use XXXTemplate funcs to manage search templates. | [
"IndexPutTemplate",
"creates",
"or",
"updates",
"an",
"index",
"template",
".",
"Use",
"XXXTemplate",
"funcs",
"to",
"manage",
"search",
"templates",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1666-L1668 | train |
olivere/elastic | client.go | IndexDeleteTemplate | func (c *Client) IndexDeleteTemplate(name string) *IndicesDeleteTemplateService {
return NewIndicesDeleteTemplateService(c).Name(name)
} | go | func (c *Client) IndexDeleteTemplate(name string) *IndicesDeleteTemplateService {
return NewIndicesDeleteTemplateService(c).Name(name)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IndexDeleteTemplate",
"(",
"name",
"string",
")",
"*",
"IndicesDeleteTemplateService",
"{",
"return",
"NewIndicesDeleteTemplateService",
"(",
"c",
")",
".",
"Name",
"(",
"name",
")",
"\n",
"}"
] | // IndexDeleteTemplate deletes an index template.
// Use XXXTemplate funcs to manage search templates. | [
"IndexDeleteTemplate",
"deletes",
"an",
"index",
"template",
".",
"Use",
"XXXTemplate",
"funcs",
"to",
"manage",
"search",
"templates",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1672-L1674 | train |
olivere/elastic | client.go | IngestGetPipeline | func (c *Client) IngestGetPipeline(ids ...string) *IngestGetPipelineService {
return NewIngestGetPipelineService(c).Id(ids...)
} | go | func (c *Client) IngestGetPipeline(ids ...string) *IngestGetPipelineService {
return NewIngestGetPipelineService(c).Id(ids...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IngestGetPipeline",
"(",
"ids",
"...",
"string",
")",
"*",
"IngestGetPipelineService",
"{",
"return",
"NewIngestGetPipelineService",
"(",
"c",
")",
".",
"Id",
"(",
"ids",
"...",
")",
"\n",
"}"
] | // IngestGetPipeline returns pipelines based on ID. | [
"IngestGetPipeline",
"returns",
"pipelines",
"based",
"on",
"ID",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1737-L1739 | train |
olivere/elastic | client.go | IngestDeletePipeline | func (c *Client) IngestDeletePipeline(id string) *IngestDeletePipelineService {
return NewIngestDeletePipelineService(c).Id(id)
} | go | func (c *Client) IngestDeletePipeline(id string) *IngestDeletePipelineService {
return NewIngestDeletePipelineService(c).Id(id)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"IngestDeletePipeline",
"(",
"id",
"string",
")",
"*",
"IngestDeletePipelineService",
"{",
"return",
"NewIngestDeletePipelineService",
"(",
"c",
")",
".",
"Id",
"(",
"id",
")",
"\n",
"}"
] | // IngestDeletePipeline deletes a pipeline by ID. | [
"IngestDeletePipeline",
"deletes",
"a",
"pipeline",
"by",
"ID",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1742-L1744 | train |
olivere/elastic | client.go | SnapshotCreateRepository | func (c *Client) SnapshotCreateRepository(repository string) *SnapshotCreateRepositoryService {
return NewSnapshotCreateRepositoryService(c).Repository(repository)
} | go | func (c *Client) SnapshotCreateRepository(repository string) *SnapshotCreateRepositoryService {
return NewSnapshotCreateRepositoryService(c).Repository(repository)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotCreateRepository",
"(",
"repository",
"string",
")",
"*",
"SnapshotCreateRepositoryService",
"{",
"return",
"NewSnapshotCreateRepositoryService",
"(",
"c",
")",
".",
"Repository",
"(",
"repository",
")",
"\n",
"}"
] | // SnapshotCreateRepository creates or updates a snapshot repository. | [
"SnapshotCreateRepository",
"creates",
"or",
"updates",
"a",
"snapshot",
"repository",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1819-L1821 | train |
olivere/elastic | client.go | SnapshotDelete | func (c *Client) SnapshotDelete(repository string, snapshot string) *SnapshotDeleteService {
return NewSnapshotDeleteService(c).Repository(repository).Snapshot(snapshot)
} | go | func (c *Client) SnapshotDelete(repository string, snapshot string) *SnapshotDeleteService {
return NewSnapshotDeleteService(c).Repository(repository).Snapshot(snapshot)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotDelete",
"(",
"repository",
"string",
",",
"snapshot",
"string",
")",
"*",
"SnapshotDeleteService",
"{",
"return",
"NewSnapshotDeleteService",
"(",
"c",
")",
".",
"Repository",
"(",
"repository",
")",
".",
"Snapshot",
"(",
"snapshot",
")",
"\n",
"}"
] | // SnapshotDelete deletes a snapshot in a snapshot repository. | [
"SnapshotDelete",
"deletes",
"a",
"snapshot",
"in",
"a",
"snapshot",
"repository",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1824-L1826 | train |
olivere/elastic | client.go | SnapshotDeleteRepository | func (c *Client) SnapshotDeleteRepository(repositories ...string) *SnapshotDeleteRepositoryService {
return NewSnapshotDeleteRepositoryService(c).Repository(repositories...)
} | go | func (c *Client) SnapshotDeleteRepository(repositories ...string) *SnapshotDeleteRepositoryService {
return NewSnapshotDeleteRepositoryService(c).Repository(repositories...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotDeleteRepository",
"(",
"repositories",
"...",
"string",
")",
"*",
"SnapshotDeleteRepositoryService",
"{",
"return",
"NewSnapshotDeleteRepositoryService",
"(",
"c",
")",
".",
"Repository",
"(",
"repositories",
"...",
")",
"\n",
"}"
] | // SnapshotDeleteRepository deletes a snapshot repository. | [
"SnapshotDeleteRepository",
"deletes",
"a",
"snapshot",
"repository",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1829-L1831 | train |
olivere/elastic | client.go | SnapshotGetRepository | func (c *Client) SnapshotGetRepository(repositories ...string) *SnapshotGetRepositoryService {
return NewSnapshotGetRepositoryService(c).Repository(repositories...)
} | go | func (c *Client) SnapshotGetRepository(repositories ...string) *SnapshotGetRepositoryService {
return NewSnapshotGetRepositoryService(c).Repository(repositories...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotGetRepository",
"(",
"repositories",
"...",
"string",
")",
"*",
"SnapshotGetRepositoryService",
"{",
"return",
"NewSnapshotGetRepositoryService",
"(",
"c",
")",
".",
"Repository",
"(",
"repositories",
"...",
")",
"\n",
"}"
] | // SnapshotGetRepository gets a snapshot repository. | [
"SnapshotGetRepository",
"gets",
"a",
"snapshot",
"repository",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1834-L1836 | train |
olivere/elastic | client.go | SnapshotGet | func (c *Client) SnapshotGet(repository string) *SnapshotGetService {
return NewSnapshotGetService(c).Repository(repository)
} | go | func (c *Client) SnapshotGet(repository string) *SnapshotGetService {
return NewSnapshotGetService(c).Repository(repository)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotGet",
"(",
"repository",
"string",
")",
"*",
"SnapshotGetService",
"{",
"return",
"NewSnapshotGetService",
"(",
"c",
")",
".",
"Repository",
"(",
"repository",
")",
"\n",
"}"
] | // SnapshotGet lists snapshot for a repository. | [
"SnapshotGet",
"lists",
"snapshot",
"for",
"a",
"repository",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1839-L1841 | train |
olivere/elastic | client.go | SnapshotVerifyRepository | func (c *Client) SnapshotVerifyRepository(repository string) *SnapshotVerifyRepositoryService {
return NewSnapshotVerifyRepositoryService(c).Repository(repository)
} | go | func (c *Client) SnapshotVerifyRepository(repository string) *SnapshotVerifyRepositoryService {
return NewSnapshotVerifyRepositoryService(c).Repository(repository)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SnapshotVerifyRepository",
"(",
"repository",
"string",
")",
"*",
"SnapshotVerifyRepositoryService",
"{",
"return",
"NewSnapshotVerifyRepositoryService",
"(",
"c",
")",
".",
"Repository",
"(",
"repository",
")",
"\n",
"}"
] | // SnapshotVerifyRepository verifies a snapshot repository. | [
"SnapshotVerifyRepository",
"verifies",
"a",
"snapshot",
"repository",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1844-L1846 | train |
olivere/elastic | client.go | XPackSecurityPutRoleMapping | func (c *Client) XPackSecurityPutRoleMapping(roleMappingName string) *XPackSecurityPutRoleMappingService {
return NewXPackSecurityPutRoleMappingService(c).Name(roleMappingName)
} | go | func (c *Client) XPackSecurityPutRoleMapping(roleMappingName string) *XPackSecurityPutRoleMappingService {
return NewXPackSecurityPutRoleMappingService(c).Name(roleMappingName)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackSecurityPutRoleMapping",
"(",
"roleMappingName",
"string",
")",
"*",
"XPackSecurityPutRoleMappingService",
"{",
"return",
"NewXPackSecurityPutRoleMappingService",
"(",
"c",
")",
".",
"Name",
"(",
"roleMappingName",
")",
"\n",
"}"
] | // XPackSecurityPutRoleMapping adds a role mapping. | [
"XPackSecurityPutRoleMapping",
"adds",
"a",
"role",
"mapping",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1882-L1884 | train |
olivere/elastic | client.go | XPackSecurityDeleteRoleMapping | func (c *Client) XPackSecurityDeleteRoleMapping(roleMappingName string) *XPackSecurityDeleteRoleMappingService {
return NewXPackSecurityDeleteRoleMappingService(c).Name(roleMappingName)
} | go | func (c *Client) XPackSecurityDeleteRoleMapping(roleMappingName string) *XPackSecurityDeleteRoleMappingService {
return NewXPackSecurityDeleteRoleMappingService(c).Name(roleMappingName)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackSecurityDeleteRoleMapping",
"(",
"roleMappingName",
"string",
")",
"*",
"XPackSecurityDeleteRoleMappingService",
"{",
"return",
"NewXPackSecurityDeleteRoleMappingService",
"(",
"c",
")",
".",
"Name",
"(",
"roleMappingName",
")",
"\n",
"}"
] | // XPackSecurityDeleteRoleMapping deletes a role mapping. | [
"XPackSecurityDeleteRoleMapping",
"deletes",
"a",
"role",
"mapping",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1887-L1889 | train |
olivere/elastic | client.go | XPackSecurityGetRole | func (c *Client) XPackSecurityGetRole(roleName string) *XPackSecurityGetRoleService {
return NewXPackSecurityGetRoleService(c).Name(roleName)
} | go | func (c *Client) XPackSecurityGetRole(roleName string) *XPackSecurityGetRoleService {
return NewXPackSecurityGetRoleService(c).Name(roleName)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackSecurityGetRole",
"(",
"roleName",
"string",
")",
"*",
"XPackSecurityGetRoleService",
"{",
"return",
"NewXPackSecurityGetRoleService",
"(",
"c",
")",
".",
"Name",
"(",
"roleName",
")",
"\n",
"}"
] | // XPackSecurityGetRole gets a role. | [
"XPackSecurityGetRole",
"gets",
"a",
"role",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1892-L1894 | train |
olivere/elastic | client.go | XPackSecurityPutRole | func (c *Client) XPackSecurityPutRole(roleName string) *XPackSecurityPutRoleService {
return NewXPackSecurityPutRoleService(c).Name(roleName)
} | go | func (c *Client) XPackSecurityPutRole(roleName string) *XPackSecurityPutRoleService {
return NewXPackSecurityPutRoleService(c).Name(roleName)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackSecurityPutRole",
"(",
"roleName",
"string",
")",
"*",
"XPackSecurityPutRoleService",
"{",
"return",
"NewXPackSecurityPutRoleService",
"(",
"c",
")",
".",
"Name",
"(",
"roleName",
")",
"\n",
"}"
] | // XPackSecurityPutRole adds a role. | [
"XPackSecurityPutRole",
"adds",
"a",
"role",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1897-L1899 | train |
olivere/elastic | client.go | XPackSecurityDeleteRole | func (c *Client) XPackSecurityDeleteRole(roleName string) *XPackSecurityDeleteRoleService {
return NewXPackSecurityDeleteRoleService(c).Name(roleName)
} | go | func (c *Client) XPackSecurityDeleteRole(roleName string) *XPackSecurityDeleteRoleService {
return NewXPackSecurityDeleteRoleService(c).Name(roleName)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackSecurityDeleteRole",
"(",
"roleName",
"string",
")",
"*",
"XPackSecurityDeleteRoleService",
"{",
"return",
"NewXPackSecurityDeleteRoleService",
"(",
"c",
")",
".",
"Name",
"(",
"roleName",
")",
"\n",
"}"
] | // XPackSecurityDeleteRole deletes a role. | [
"XPackSecurityDeleteRole",
"deletes",
"a",
"role",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1902-L1904 | train |
olivere/elastic | client.go | XPackWatchGet | func (c *Client) XPackWatchGet(watchId string) *XPackWatcherGetWatchService {
return NewXPackWatcherGetWatchService(c).Id(watchId)
} | go | func (c *Client) XPackWatchGet(watchId string) *XPackWatcherGetWatchService {
return NewXPackWatcherGetWatchService(c).Id(watchId)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackWatchGet",
"(",
"watchId",
"string",
")",
"*",
"XPackWatcherGetWatchService",
"{",
"return",
"NewXPackWatcherGetWatchService",
"(",
"c",
")",
".",
"Id",
"(",
"watchId",
")",
"\n",
"}"
] | // XPackWatchGet gets a watch. | [
"XPackWatchGet",
"gets",
"a",
"watch",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1917-L1919 | train |
olivere/elastic | client.go | XPackWatchDelete | func (c *Client) XPackWatchDelete(watchId string) *XPackWatcherDeleteWatchService {
return NewXPackWatcherDeleteWatchService(c).Id(watchId)
} | go | func (c *Client) XPackWatchDelete(watchId string) *XPackWatcherDeleteWatchService {
return NewXPackWatcherDeleteWatchService(c).Id(watchId)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackWatchDelete",
"(",
"watchId",
"string",
")",
"*",
"XPackWatcherDeleteWatchService",
"{",
"return",
"NewXPackWatcherDeleteWatchService",
"(",
"c",
")",
".",
"Id",
"(",
"watchId",
")",
"\n",
"}"
] | // XPackWatchDelete deletes a watch. | [
"XPackWatchDelete",
"deletes",
"a",
"watch",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1922-L1924 | train |
olivere/elastic | client.go | XPackWatchAck | func (c *Client) XPackWatchAck(watchId string) *XPackWatcherAckWatchService {
return NewXPackWatcherAckWatchService(c).WatchId(watchId)
} | go | func (c *Client) XPackWatchAck(watchId string) *XPackWatcherAckWatchService {
return NewXPackWatcherAckWatchService(c).WatchId(watchId)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackWatchAck",
"(",
"watchId",
"string",
")",
"*",
"XPackWatcherAckWatchService",
"{",
"return",
"NewXPackWatcherAckWatchService",
"(",
"c",
")",
".",
"WatchId",
"(",
"watchId",
")",
"\n",
"}"
] | // XPackWatchAck acknowledging a watch. | [
"XPackWatchAck",
"acknowledging",
"a",
"watch",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1932-L1934 | train |
olivere/elastic | client.go | XPackWatchActivate | func (c *Client) XPackWatchActivate(watchId string) *XPackWatcherActivateWatchService {
return NewXPackWatcherActivateWatchService(c).WatchId(watchId)
} | go | func (c *Client) XPackWatchActivate(watchId string) *XPackWatcherActivateWatchService {
return NewXPackWatcherActivateWatchService(c).WatchId(watchId)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackWatchActivate",
"(",
"watchId",
"string",
")",
"*",
"XPackWatcherActivateWatchService",
"{",
"return",
"NewXPackWatcherActivateWatchService",
"(",
"c",
")",
".",
"WatchId",
"(",
"watchId",
")",
"\n",
"}"
] | // XPackWatchActivate activates a watch. | [
"XPackWatchActivate",
"activates",
"a",
"watch",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1937-L1939 | train |
olivere/elastic | client.go | XPackWatchDeactivate | func (c *Client) XPackWatchDeactivate(watchId string) *XPackWatcherDeactivateWatchService {
return NewXPackWatcherDeactivateWatchService(c).WatchId(watchId)
} | go | func (c *Client) XPackWatchDeactivate(watchId string) *XPackWatcherDeactivateWatchService {
return NewXPackWatcherDeactivateWatchService(c).WatchId(watchId)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"XPackWatchDeactivate",
"(",
"watchId",
"string",
")",
"*",
"XPackWatcherDeactivateWatchService",
"{",
"return",
"NewXPackWatcherDeactivateWatchService",
"(",
"c",
")",
".",
"WatchId",
"(",
"watchId",
")",
"\n",
"}"
] | // XPackWatchDeactivate deactivates a watch. | [
"XPackWatchDeactivate",
"deactivates",
"a",
"watch",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/client.go#L1942-L1944 | train |
olivere/elastic | search_aggs_bucket_date_histogram.go | MinDocCount | func (a *DateHistogramAggregation) MinDocCount(minDocCount int64) *DateHistogramAggregation {
a.minDocCount = &minDocCount
return a
} | go | func (a *DateHistogramAggregation) MinDocCount(minDocCount int64) *DateHistogramAggregation {
a.minDocCount = &minDocCount
return a
} | [
"func",
"(",
"a",
"*",
"DateHistogramAggregation",
")",
"MinDocCount",
"(",
"minDocCount",
"int64",
")",
"*",
"DateHistogramAggregation",
"{",
"a",
".",
"minDocCount",
"=",
"&",
"minDocCount",
"\n",
"return",
"a",
"\n",
"}"
] | // MinDocCount sets the minimum document count per bucket.
// Buckets with less documents than this min value will not be returned. | [
"MinDocCount",
"sets",
"the",
"minimum",
"document",
"count",
"per",
"bucket",
".",
"Buckets",
"with",
"less",
"documents",
"than",
"this",
"min",
"value",
"will",
"not",
"be",
"returned",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_aggs_bucket_date_histogram.go#L156-L159 | train |
olivere/elastic | search_aggs_bucket_date_histogram.go | TimeZone | func (a *DateHistogramAggregation) TimeZone(timeZone string) *DateHistogramAggregation {
a.timeZone = timeZone
return a
} | go | func (a *DateHistogramAggregation) TimeZone(timeZone string) *DateHistogramAggregation {
a.timeZone = timeZone
return a
} | [
"func",
"(",
"a",
"*",
"DateHistogramAggregation",
")",
"TimeZone",
"(",
"timeZone",
"string",
")",
"*",
"DateHistogramAggregation",
"{",
"a",
".",
"timeZone",
"=",
"timeZone",
"\n",
"return",
"a",
"\n",
"}"
] | // TimeZone sets the timezone in which to translate dates before computing buckets. | [
"TimeZone",
"sets",
"the",
"timezone",
"in",
"which",
"to",
"translate",
"dates",
"before",
"computing",
"buckets",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_aggs_bucket_date_histogram.go#L162-L165 | train |
olivere/elastic | search_aggs_bucket_date_histogram.go | ExtendedBounds | func (a *DateHistogramAggregation) ExtendedBounds(min, max interface{}) *DateHistogramAggregation {
a.extendedBoundsMin = min
a.extendedBoundsMax = max
return a
} | go | func (a *DateHistogramAggregation) ExtendedBounds(min, max interface{}) *DateHistogramAggregation {
a.extendedBoundsMin = min
a.extendedBoundsMax = max
return a
} | [
"func",
"(",
"a",
"*",
"DateHistogramAggregation",
")",
"ExtendedBounds",
"(",
"min",
",",
"max",
"interface",
"{",
"}",
")",
"*",
"DateHistogramAggregation",
"{",
"a",
".",
"extendedBoundsMin",
"=",
"min",
"\n",
"a",
".",
"extendedBoundsMax",
"=",
"max",
"\n",
"return",
"a",
"\n",
"}"
] | // ExtendedBounds accepts int, int64, string, or time.Time values.
// In case the lower value in the histogram would be greater than min or the
// upper value would be less than max, empty buckets will be generated. | [
"ExtendedBounds",
"accepts",
"int",
"int64",
"string",
"or",
"time",
".",
"Time",
"values",
".",
"In",
"case",
"the",
"lower",
"value",
"in",
"the",
"histogram",
"would",
"be",
"greater",
"than",
"min",
"or",
"the",
"upper",
"value",
"would",
"be",
"less",
"than",
"max",
"empty",
"buckets",
"will",
"be",
"generated",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_aggs_bucket_date_histogram.go#L182-L186 | train |
olivere/elastic | ingest_put_pipeline.go | Id | func (s *IngestPutPipelineService) Id(id string) *IngestPutPipelineService {
s.id = id
return s
} | go | func (s *IngestPutPipelineService) Id(id string) *IngestPutPipelineService {
s.id = id
return s
} | [
"func",
"(",
"s",
"*",
"IngestPutPipelineService",
")",
"Id",
"(",
"id",
"string",
")",
"*",
"IngestPutPipelineService",
"{",
"s",
".",
"id",
"=",
"id",
"\n",
"return",
"s",
"\n",
"}"
] | // Id is the pipeline ID. | [
"Id",
"is",
"the",
"pipeline",
"ID",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/ingest_put_pipeline.go#L38-L41 | train |
olivere/elastic | ingest_put_pipeline.go | BodyString | func (s *IngestPutPipelineService) BodyString(body string) *IngestPutPipelineService {
s.bodyString = body
return s
} | go | func (s *IngestPutPipelineService) BodyString(body string) *IngestPutPipelineService {
s.bodyString = body
return s
} | [
"func",
"(",
"s",
"*",
"IngestPutPipelineService",
")",
"BodyString",
"(",
"body",
"string",
")",
"*",
"IngestPutPipelineService",
"{",
"s",
".",
"bodyString",
"=",
"body",
"\n",
"return",
"s",
"\n",
"}"
] | // BodyString is the ingest definition, specified as a string. | [
"BodyString",
"is",
"the",
"ingest",
"definition",
"specified",
"as",
"a",
"string",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/ingest_put_pipeline.go#L69-L72 | train |
olivere/elastic | bulk_delete_request.go | Index | func (r *BulkDeleteRequest) Index(index string) *BulkDeleteRequest {
r.index = index
r.source = nil
return r
} | go | func (r *BulkDeleteRequest) Index(index string) *BulkDeleteRequest {
r.index = index
r.source = nil
return r
} | [
"func",
"(",
"r",
"*",
"BulkDeleteRequest",
")",
"Index",
"(",
"index",
"string",
")",
"*",
"BulkDeleteRequest",
"{",
"r",
".",
"index",
"=",
"index",
"\n",
"r",
".",
"source",
"=",
"nil",
"\n",
"return",
"r",
"\n",
"}"
] | // Index specifies the Elasticsearch index to use for this delete request.
// If unspecified, the index set on the BulkService will be used. | [
"Index",
"specifies",
"the",
"Elasticsearch",
"index",
"to",
"use",
"for",
"this",
"delete",
"request",
".",
"If",
"unspecified",
"the",
"index",
"set",
"on",
"the",
"BulkService",
"will",
"be",
"used",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/bulk_delete_request.go#L67-L71 | train |
olivere/elastic | bulk_delete_request.go | Type | func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest {
r.typ = typ
r.source = nil
return r
} | go | func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest {
r.typ = typ
r.source = nil
return r
} | [
"func",
"(",
"r",
"*",
"BulkDeleteRequest",
")",
"Type",
"(",
"typ",
"string",
")",
"*",
"BulkDeleteRequest",
"{",
"r",
".",
"typ",
"=",
"typ",
"\n",
"r",
".",
"source",
"=",
"nil",
"\n",
"return",
"r",
"\n",
"}"
] | // Type specifies the Elasticsearch type to use for this delete request.
// If unspecified, the type set on the BulkService will be used. | [
"Type",
"specifies",
"the",
"Elasticsearch",
"type",
"to",
"use",
"for",
"this",
"delete",
"request",
".",
"If",
"unspecified",
"the",
"type",
"set",
"on",
"the",
"BulkService",
"will",
"be",
"used",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/bulk_delete_request.go#L75-L79 | train |
olivere/elastic | bulk_delete_request.go | Id | func (r *BulkDeleteRequest) Id(id string) *BulkDeleteRequest {
r.id = id
r.source = nil
return r
} | go | func (r *BulkDeleteRequest) Id(id string) *BulkDeleteRequest {
r.id = id
r.source = nil
return r
} | [
"func",
"(",
"r",
"*",
"BulkDeleteRequest",
")",
"Id",
"(",
"id",
"string",
")",
"*",
"BulkDeleteRequest",
"{",
"r",
".",
"id",
"=",
"id",
"\n",
"r",
".",
"source",
"=",
"nil",
"\n",
"return",
"r",
"\n",
"}"
] | // Id specifies the identifier of the document to delete. | [
"Id",
"specifies",
"the",
"identifier",
"of",
"the",
"document",
"to",
"delete",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/bulk_delete_request.go#L82-L86 | train |
olivere/elastic | bulk_delete_request.go | Version | func (r *BulkDeleteRequest) Version(version int64) *BulkDeleteRequest {
r.version = version
r.source = nil
return r
} | go | func (r *BulkDeleteRequest) Version(version int64) *BulkDeleteRequest {
r.version = version
r.source = nil
return r
} | [
"func",
"(",
"r",
"*",
"BulkDeleteRequest",
")",
"Version",
"(",
"version",
"int64",
")",
"*",
"BulkDeleteRequest",
"{",
"r",
".",
"version",
"=",
"version",
"\n",
"r",
".",
"source",
"=",
"nil",
"\n",
"return",
"r",
"\n",
"}"
] | // Version indicates the version to be deleted as part of an optimistic
// concurrency model. | [
"Version",
"indicates",
"the",
"version",
"to",
"be",
"deleted",
"as",
"part",
"of",
"an",
"optimistic",
"concurrency",
"model",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/bulk_delete_request.go#L105-L109 | train |
olivere/elastic | xpack_watcher_ack_watch.go | WatchId | func (s *XPackWatcherAckWatchService) WatchId(watchId string) *XPackWatcherAckWatchService {
s.watchId = watchId
return s
} | go | func (s *XPackWatcherAckWatchService) WatchId(watchId string) *XPackWatcherAckWatchService {
s.watchId = watchId
return s
} | [
"func",
"(",
"s",
"*",
"XPackWatcherAckWatchService",
")",
"WatchId",
"(",
"watchId",
"string",
")",
"*",
"XPackWatcherAckWatchService",
"{",
"s",
".",
"watchId",
"=",
"watchId",
"\n",
"return",
"s",
"\n",
"}"
] | // WatchId is the unique ID of the watch. | [
"WatchId",
"is",
"the",
"unique",
"ID",
"of",
"the",
"watch",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/xpack_watcher_ack_watch.go#L35-L38 | train |
olivere/elastic | xpack_watcher_ack_watch.go | ActionId | func (s *XPackWatcherAckWatchService) ActionId(actionId ...string) *XPackWatcherAckWatchService {
s.actionId = append(s.actionId, actionId...)
return s
} | go | func (s *XPackWatcherAckWatchService) ActionId(actionId ...string) *XPackWatcherAckWatchService {
s.actionId = append(s.actionId, actionId...)
return s
} | [
"func",
"(",
"s",
"*",
"XPackWatcherAckWatchService",
")",
"ActionId",
"(",
"actionId",
"...",
"string",
")",
"*",
"XPackWatcherAckWatchService",
"{",
"s",
".",
"actionId",
"=",
"append",
"(",
"s",
".",
"actionId",
",",
"actionId",
"...",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // ActionId is a slice of action ids to be acked. | [
"ActionId",
"is",
"a",
"slice",
"of",
"action",
"ids",
"to",
"be",
"acked",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/xpack_watcher_ack_watch.go#L41-L44 | train |
olivere/elastic | xpack_watcher_ack_watch.go | MasterTimeout | func (s *XPackWatcherAckWatchService) MasterTimeout(masterTimeout string) *XPackWatcherAckWatchService {
s.masterTimeout = masterTimeout
return s
} | go | func (s *XPackWatcherAckWatchService) MasterTimeout(masterTimeout string) *XPackWatcherAckWatchService {
s.masterTimeout = masterTimeout
return s
} | [
"func",
"(",
"s",
"*",
"XPackWatcherAckWatchService",
")",
"MasterTimeout",
"(",
"masterTimeout",
"string",
")",
"*",
"XPackWatcherAckWatchService",
"{",
"s",
".",
"masterTimeout",
"=",
"masterTimeout",
"\n",
"return",
"s",
"\n",
"}"
] | // MasterTimeout indicates an explicit operation timeout for
// connection to master node. | [
"MasterTimeout",
"indicates",
"an",
"explicit",
"operation",
"timeout",
"for",
"connection",
"to",
"master",
"node",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/xpack_watcher_ack_watch.go#L48-L51 | train |
olivere/elastic | retrier.go | Retry | func (f RetrierFunc) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {
return f(ctx, retry, req, resp, err)
} | go | func (f RetrierFunc) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {
return f(ctx, retry, req, resp, err)
} | [
"func",
"(",
"f",
"RetrierFunc",
")",
"Retry",
"(",
"ctx",
"context",
".",
"Context",
",",
"retry",
"int",
",",
"req",
"*",
"http",
".",
"Request",
",",
"resp",
"*",
"http",
".",
"Response",
",",
"err",
"error",
")",
"(",
"time",
".",
"Duration",
",",
"bool",
",",
"error",
")",
"{",
"return",
"f",
"(",
"ctx",
",",
"retry",
",",
"req",
",",
"resp",
",",
"err",
")",
"\n",
"}"
] | // Retry calls f. | [
"Retry",
"calls",
"f",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/retrier.go#L19-L21 | train |
olivere/elastic | retrier.go | Retry | func (r *StopRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {
return 0, false, nil
} | go | func (r *StopRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {
return 0, false, nil
} | [
"func",
"(",
"r",
"*",
"StopRetrier",
")",
"Retry",
"(",
"ctx",
"context",
".",
"Context",
",",
"retry",
"int",
",",
"req",
"*",
"http",
".",
"Request",
",",
"resp",
"*",
"http",
".",
"Response",
",",
"err",
"error",
")",
"(",
"time",
".",
"Duration",
",",
"bool",
",",
"error",
")",
"{",
"return",
"0",
",",
"false",
",",
"nil",
"\n",
"}"
] | // Retry does not retry. | [
"Retry",
"does",
"not",
"retry",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/retrier.go#L48-L50 | train |
olivere/elastic | retrier.go | Retry | func (r *BackoffRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {
wait, goahead := r.backoff.Next(retry)
return wait, goahead, nil
} | go | func (r *BackoffRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {
wait, goahead := r.backoff.Next(retry)
return wait, goahead, nil
} | [
"func",
"(",
"r",
"*",
"BackoffRetrier",
")",
"Retry",
"(",
"ctx",
"context",
".",
"Context",
",",
"retry",
"int",
",",
"req",
"*",
"http",
".",
"Request",
",",
"resp",
"*",
"http",
".",
"Response",
",",
"err",
"error",
")",
"(",
"time",
".",
"Duration",
",",
"bool",
",",
"error",
")",
"{",
"wait",
",",
"goahead",
":=",
"r",
".",
"backoff",
".",
"Next",
"(",
"retry",
")",
"\n",
"return",
"wait",
",",
"goahead",
",",
"nil",
"\n",
"}"
] | // Retry calls into the backoff strategy and its wait interval. | [
"Retry",
"calls",
"into",
"the",
"backoff",
"strategy",
"and",
"its",
"wait",
"interval",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/retrier.go#L65-L68 | train |
olivere/elastic | indices_put_alias.go | Filter | func (a *AliasAddAction) Filter(filter Query) *AliasAddAction {
a.filter = filter
return a
} | go | func (a *AliasAddAction) Filter(filter Query) *AliasAddAction {
a.filter = filter
return a
} | [
"func",
"(",
"a",
"*",
"AliasAddAction",
")",
"Filter",
"(",
"filter",
"Query",
")",
"*",
"AliasAddAction",
"{",
"a",
".",
"filter",
"=",
"filter",
"\n",
"return",
"a",
"\n",
"}"
] | // Filter associates a filter to the alias. | [
"Filter",
"associates",
"a",
"filter",
"to",
"the",
"alias",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L56-L59 | train |
olivere/elastic | indices_put_alias.go | Routing | func (a *AliasAddAction) Routing(routing string) *AliasAddAction {
a.routing = routing
return a
} | go | func (a *AliasAddAction) Routing(routing string) *AliasAddAction {
a.routing = routing
return a
} | [
"func",
"(",
"a",
"*",
"AliasAddAction",
")",
"Routing",
"(",
"routing",
"string",
")",
"*",
"AliasAddAction",
"{",
"a",
".",
"routing",
"=",
"routing",
"\n",
"return",
"a",
"\n",
"}"
] | // Routing associates a routing value to the alias.
// This basically sets index and search routing to the same value. | [
"Routing",
"associates",
"a",
"routing",
"value",
"to",
"the",
"alias",
".",
"This",
"basically",
"sets",
"index",
"and",
"search",
"routing",
"to",
"the",
"same",
"value",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L63-L66 | train |
olivere/elastic | indices_put_alias.go | IndexRouting | func (a *AliasAddAction) IndexRouting(routing string) *AliasAddAction {
a.indexRouting = routing
return a
} | go | func (a *AliasAddAction) IndexRouting(routing string) *AliasAddAction {
a.indexRouting = routing
return a
} | [
"func",
"(",
"a",
"*",
"AliasAddAction",
")",
"IndexRouting",
"(",
"routing",
"string",
")",
"*",
"AliasAddAction",
"{",
"a",
".",
"indexRouting",
"=",
"routing",
"\n",
"return",
"a",
"\n",
"}"
] | // IndexRouting associates an index routing value to the alias. | [
"IndexRouting",
"associates",
"an",
"index",
"routing",
"value",
"to",
"the",
"alias",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L69-L72 | train |
olivere/elastic | indices_put_alias.go | SearchRouting | func (a *AliasAddAction) SearchRouting(routing ...string) *AliasAddAction {
a.searchRouting = strings.Join(routing, ",")
return a
} | go | func (a *AliasAddAction) SearchRouting(routing ...string) *AliasAddAction {
a.searchRouting = strings.Join(routing, ",")
return a
} | [
"func",
"(",
"a",
"*",
"AliasAddAction",
")",
"SearchRouting",
"(",
"routing",
"...",
"string",
")",
"*",
"AliasAddAction",
"{",
"a",
".",
"searchRouting",
"=",
"strings",
".",
"Join",
"(",
"routing",
",",
"\"",
"\"",
")",
"\n",
"return",
"a",
"\n",
"}"
] | // SearchRouting associates a search routing value to the alias. | [
"SearchRouting",
"associates",
"a",
"search",
"routing",
"value",
"to",
"the",
"alias",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L75-L78 | train |
olivere/elastic | indices_put_alias.go | IsWriteIndex | func (a *AliasAddAction) IsWriteIndex(flag bool) *AliasAddAction {
a.isWriteIndex = &flag
return a
} | go | func (a *AliasAddAction) IsWriteIndex(flag bool) *AliasAddAction {
a.isWriteIndex = &flag
return a
} | [
"func",
"(",
"a",
"*",
"AliasAddAction",
")",
"IsWriteIndex",
"(",
"flag",
"bool",
")",
"*",
"AliasAddAction",
"{",
"a",
".",
"isWriteIndex",
"=",
"&",
"flag",
"\n",
"return",
"a",
"\n",
"}"
] | // IsWriteIndex associates an is_write_index flag to the alias. | [
"IsWriteIndex",
"associates",
"an",
"is_write_index",
"flag",
"to",
"the",
"alias",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L81-L84 | train |
olivere/elastic | indices_put_alias.go | Pretty | func (s *AliasService) Pretty(pretty bool) *AliasService {
s.pretty = pretty
return s
} | go | func (s *AliasService) Pretty(pretty bool) *AliasService {
s.pretty = pretty
return s
} | [
"func",
"(",
"s",
"*",
"AliasService",
")",
"Pretty",
"(",
"pretty",
"bool",
")",
"*",
"AliasService",
"{",
"s",
".",
"pretty",
"=",
"pretty",
"\n",
"return",
"s",
"\n",
"}"
] | // Pretty asks Elasticsearch to indent the HTTP response. | [
"Pretty",
"asks",
"Elasticsearch",
"to",
"indent",
"the",
"HTTP",
"response",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L258-L261 | train |
olivere/elastic | indices_put_alias.go | Add | func (s *AliasService) Add(indexName string, aliasName string) *AliasService {
action := NewAliasAddAction(aliasName).Index(indexName)
s.actions = append(s.actions, action)
return s
} | go | func (s *AliasService) Add(indexName string, aliasName string) *AliasService {
action := NewAliasAddAction(aliasName).Index(indexName)
s.actions = append(s.actions, action)
return s
} | [
"func",
"(",
"s",
"*",
"AliasService",
")",
"Add",
"(",
"indexName",
"string",
",",
"aliasName",
"string",
")",
"*",
"AliasService",
"{",
"action",
":=",
"NewAliasAddAction",
"(",
"aliasName",
")",
".",
"Index",
"(",
"indexName",
")",
"\n",
"s",
".",
"actions",
"=",
"append",
"(",
"s",
".",
"actions",
",",
"action",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Add adds an alias to an index. | [
"Add",
"adds",
"an",
"alias",
"to",
"an",
"index",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L264-L268 | train |
olivere/elastic | indices_put_alias.go | AddWithFilter | func (s *AliasService) AddWithFilter(indexName string, aliasName string, filter Query) *AliasService {
action := NewAliasAddAction(aliasName).Index(indexName).Filter(filter)
s.actions = append(s.actions, action)
return s
} | go | func (s *AliasService) AddWithFilter(indexName string, aliasName string, filter Query) *AliasService {
action := NewAliasAddAction(aliasName).Index(indexName).Filter(filter)
s.actions = append(s.actions, action)
return s
} | [
"func",
"(",
"s",
"*",
"AliasService",
")",
"AddWithFilter",
"(",
"indexName",
"string",
",",
"aliasName",
"string",
",",
"filter",
"Query",
")",
"*",
"AliasService",
"{",
"action",
":=",
"NewAliasAddAction",
"(",
"aliasName",
")",
".",
"Index",
"(",
"indexName",
")",
".",
"Filter",
"(",
"filter",
")",
"\n",
"s",
".",
"actions",
"=",
"append",
"(",
"s",
".",
"actions",
",",
"action",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Add adds an alias to an index and associates a filter to the alias. | [
"Add",
"adds",
"an",
"alias",
"to",
"an",
"index",
"and",
"associates",
"a",
"filter",
"to",
"the",
"alias",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L271-L275 | train |
olivere/elastic | indices_put_alias.go | Remove | func (s *AliasService) Remove(indexName string, aliasName string) *AliasService {
action := NewAliasRemoveAction(aliasName).Index(indexName)
s.actions = append(s.actions, action)
return s
} | go | func (s *AliasService) Remove(indexName string, aliasName string) *AliasService {
action := NewAliasRemoveAction(aliasName).Index(indexName)
s.actions = append(s.actions, action)
return s
} | [
"func",
"(",
"s",
"*",
"AliasService",
")",
"Remove",
"(",
"indexName",
"string",
",",
"aliasName",
"string",
")",
"*",
"AliasService",
"{",
"action",
":=",
"NewAliasRemoveAction",
"(",
"aliasName",
")",
".",
"Index",
"(",
"indexName",
")",
"\n",
"s",
".",
"actions",
"=",
"append",
"(",
"s",
".",
"actions",
",",
"action",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Remove removes an alias. | [
"Remove",
"removes",
"an",
"alias",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L278-L282 | train |
olivere/elastic | indices_put_alias.go | Action | func (s *AliasService) Action(action ...AliasAction) *AliasService {
s.actions = append(s.actions, action...)
return s
} | go | func (s *AliasService) Action(action ...AliasAction) *AliasService {
s.actions = append(s.actions, action...)
return s
} | [
"func",
"(",
"s",
"*",
"AliasService",
")",
"Action",
"(",
"action",
"...",
"AliasAction",
")",
"*",
"AliasService",
"{",
"s",
".",
"actions",
"=",
"append",
"(",
"s",
".",
"actions",
",",
"action",
"...",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Action accepts one or more AliasAction instances which can be
// of type AliasAddAction or AliasRemoveAction. | [
"Action",
"accepts",
"one",
"or",
"more",
"AliasAction",
"instances",
"which",
"can",
"be",
"of",
"type",
"AliasAddAction",
"or",
"AliasRemoveAction",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L286-L289 | train |
olivere/elastic | indices_put_alias.go | Do | func (s *AliasService) Do(ctx context.Context) (*AliasResult, error) {
path, params, err := s.buildURL()
if err != nil {
return nil, err
}
// Body with actions
body := make(map[string]interface{})
var actions []interface{}
for _, action := range s.actions {
src, err := action.Source()
if err != nil {
return nil, err
}
actions = append(actions, src)
}
body["actions"] = actions
// Get response
res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
Method: "POST",
Path: path,
Params: params,
Body: body,
})
if err != nil {
return nil, err
}
// Return results
ret := new(AliasResult)
if err := s.client.decoder.Decode(res.Body, ret); err != nil {
return nil, err
}
return ret, nil
} | go | func (s *AliasService) Do(ctx context.Context) (*AliasResult, error) {
path, params, err := s.buildURL()
if err != nil {
return nil, err
}
// Body with actions
body := make(map[string]interface{})
var actions []interface{}
for _, action := range s.actions {
src, err := action.Source()
if err != nil {
return nil, err
}
actions = append(actions, src)
}
body["actions"] = actions
// Get response
res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
Method: "POST",
Path: path,
Params: params,
Body: body,
})
if err != nil {
return nil, err
}
// Return results
ret := new(AliasResult)
if err := s.client.decoder.Decode(res.Body, ret); err != nil {
return nil, err
}
return ret, nil
} | [
"func",
"(",
"s",
"*",
"AliasService",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"*",
"AliasResult",
",",
"error",
")",
"{",
"path",
",",
"params",
",",
"err",
":=",
"s",
".",
"buildURL",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Body with actions",
"body",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"var",
"actions",
"[",
"]",
"interface",
"{",
"}",
"\n",
"for",
"_",
",",
"action",
":=",
"range",
"s",
".",
"actions",
"{",
"src",
",",
"err",
":=",
"action",
".",
"Source",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"actions",
"=",
"append",
"(",
"actions",
",",
"src",
")",
"\n",
"}",
"\n",
"body",
"[",
"\"",
"\"",
"]",
"=",
"actions",
"\n\n",
"// Get response",
"res",
",",
"err",
":=",
"s",
".",
"client",
".",
"PerformRequest",
"(",
"ctx",
",",
"PerformRequestOptions",
"{",
"Method",
":",
"\"",
"\"",
",",
"Path",
":",
"path",
",",
"Params",
":",
"params",
",",
"Body",
":",
"body",
",",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Return results",
"ret",
":=",
"new",
"(",
"AliasResult",
")",
"\n",
"if",
"err",
":=",
"s",
".",
"client",
".",
"decoder",
".",
"Decode",
"(",
"res",
".",
"Body",
",",
"ret",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"ret",
",",
"nil",
"\n",
"}"
] | // Do executes the command. | [
"Do",
"executes",
"the",
"command",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_put_alias.go#L304-L339 | train |
olivere/elastic | request.go | SetBasicAuth | func (r *Request) SetBasicAuth(username, password string) {
((*http.Request)(r)).SetBasicAuth(username, password)
} | go | func (r *Request) SetBasicAuth(username, password string) {
((*http.Request)(r)).SetBasicAuth(username, password)
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"SetBasicAuth",
"(",
"username",
",",
"password",
"string",
")",
"{",
"(",
"(",
"*",
"http",
".",
"Request",
")",
"(",
"r",
")",
")",
".",
"SetBasicAuth",
"(",
"username",
",",
"password",
")",
"\n",
"}"
] | // SetBasicAuth wraps http.Request's SetBasicAuth. | [
"SetBasicAuth",
"wraps",
"http",
".",
"Request",
"s",
"SetBasicAuth",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/request.go#L34-L36 | train |
olivere/elastic | request.go | SetBody | func (r *Request) SetBody(body interface{}, gzipCompress bool) error {
switch b := body.(type) {
case string:
if gzipCompress {
return r.setBodyGzip(b)
}
return r.setBodyString(b)
default:
if gzipCompress {
return r.setBodyGzip(body)
}
return r.setBodyJson(body)
}
} | go | func (r *Request) SetBody(body interface{}, gzipCompress bool) error {
switch b := body.(type) {
case string:
if gzipCompress {
return r.setBodyGzip(b)
}
return r.setBodyString(b)
default:
if gzipCompress {
return r.setBodyGzip(body)
}
return r.setBodyJson(body)
}
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"SetBody",
"(",
"body",
"interface",
"{",
"}",
",",
"gzipCompress",
"bool",
")",
"error",
"{",
"switch",
"b",
":=",
"body",
".",
"(",
"type",
")",
"{",
"case",
"string",
":",
"if",
"gzipCompress",
"{",
"return",
"r",
".",
"setBodyGzip",
"(",
"b",
")",
"\n",
"}",
"\n",
"return",
"r",
".",
"setBodyString",
"(",
"b",
")",
"\n",
"default",
":",
"if",
"gzipCompress",
"{",
"return",
"r",
".",
"setBodyGzip",
"(",
"body",
")",
"\n",
"}",
"\n",
"return",
"r",
".",
"setBodyJson",
"(",
"body",
")",
"\n",
"}",
"\n",
"}"
] | // SetBody encodes the body in the request. You may pass a flag to
// compress the request via gzip. | [
"SetBody",
"encodes",
"the",
"body",
"in",
"the",
"request",
".",
"You",
"may",
"pass",
"a",
"flag",
"to",
"compress",
"the",
"request",
"via",
"gzip",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/request.go#L40-L53 | train |
olivere/elastic | request.go | setBodyJson | func (r *Request) setBodyJson(data interface{}) error {
body, err := json.Marshal(data)
if err != nil {
return err
}
r.Header.Set("Content-Type", "application/json")
r.setBodyReader(bytes.NewReader(body))
return nil
} | go | func (r *Request) setBodyJson(data interface{}) error {
body, err := json.Marshal(data)
if err != nil {
return err
}
r.Header.Set("Content-Type", "application/json")
r.setBodyReader(bytes.NewReader(body))
return nil
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"setBodyJson",
"(",
"data",
"interface",
"{",
"}",
")",
"error",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"data",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"r",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"r",
".",
"setBodyReader",
"(",
"bytes",
".",
"NewReader",
"(",
"body",
")",
")",
"\n",
"return",
"nil",
"\n",
"}"
] | // setBodyJson encodes the body as a struct to be marshaled via json.Marshal. | [
"setBodyJson",
"encodes",
"the",
"body",
"as",
"a",
"struct",
"to",
"be",
"marshaled",
"via",
"json",
".",
"Marshal",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/request.go#L56-L64 | train |
olivere/elastic | request.go | setBodyString | func (r *Request) setBodyString(body string) error {
return r.setBodyReader(strings.NewReader(body))
} | go | func (r *Request) setBodyString(body string) error {
return r.setBodyReader(strings.NewReader(body))
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"setBodyString",
"(",
"body",
"string",
")",
"error",
"{",
"return",
"r",
".",
"setBodyReader",
"(",
"strings",
".",
"NewReader",
"(",
"body",
")",
")",
"\n",
"}"
] | // setBodyString encodes the body as a string. | [
"setBodyString",
"encodes",
"the",
"body",
"as",
"a",
"string",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/request.go#L67-L69 | train |
olivere/elastic | request.go | setBodyGzip | func (r *Request) setBodyGzip(body interface{}) error {
switch b := body.(type) {
case string:
buf := new(bytes.Buffer)
w := gzip.NewWriter(buf)
if _, err := w.Write([]byte(b)); err != nil {
return err
}
if err := w.Close(); err != nil {
return err
}
r.Header.Add("Content-Encoding", "gzip")
r.Header.Add("Vary", "Accept-Encoding")
return r.setBodyReader(bytes.NewReader(buf.Bytes()))
default:
data, err := json.Marshal(b)
if err != nil {
return err
}
buf := new(bytes.Buffer)
w := gzip.NewWriter(buf)
if _, err := w.Write(data); err != nil {
return err
}
if err := w.Close(); err != nil {
return err
}
r.Header.Add("Content-Encoding", "gzip")
r.Header.Add("Vary", "Accept-Encoding")
r.Header.Set("Content-Type", "application/json")
return r.setBodyReader(bytes.NewReader(buf.Bytes()))
}
} | go | func (r *Request) setBodyGzip(body interface{}) error {
switch b := body.(type) {
case string:
buf := new(bytes.Buffer)
w := gzip.NewWriter(buf)
if _, err := w.Write([]byte(b)); err != nil {
return err
}
if err := w.Close(); err != nil {
return err
}
r.Header.Add("Content-Encoding", "gzip")
r.Header.Add("Vary", "Accept-Encoding")
return r.setBodyReader(bytes.NewReader(buf.Bytes()))
default:
data, err := json.Marshal(b)
if err != nil {
return err
}
buf := new(bytes.Buffer)
w := gzip.NewWriter(buf)
if _, err := w.Write(data); err != nil {
return err
}
if err := w.Close(); err != nil {
return err
}
r.Header.Add("Content-Encoding", "gzip")
r.Header.Add("Vary", "Accept-Encoding")
r.Header.Set("Content-Type", "application/json")
return r.setBodyReader(bytes.NewReader(buf.Bytes()))
}
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"setBodyGzip",
"(",
"body",
"interface",
"{",
"}",
")",
"error",
"{",
"switch",
"b",
":=",
"body",
".",
"(",
"type",
")",
"{",
"case",
"string",
":",
"buf",
":=",
"new",
"(",
"bytes",
".",
"Buffer",
")",
"\n",
"w",
":=",
"gzip",
".",
"NewWriter",
"(",
"buf",
")",
"\n",
"if",
"_",
",",
"err",
":=",
"w",
".",
"Write",
"(",
"[",
"]",
"byte",
"(",
"b",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"err",
":=",
"w",
".",
"Close",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"r",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"r",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"r",
".",
"setBodyReader",
"(",
"bytes",
".",
"NewReader",
"(",
"buf",
".",
"Bytes",
"(",
")",
")",
")",
"\n",
"default",
":",
"data",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"b",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"buf",
":=",
"new",
"(",
"bytes",
".",
"Buffer",
")",
"\n",
"w",
":=",
"gzip",
".",
"NewWriter",
"(",
"buf",
")",
"\n",
"if",
"_",
",",
"err",
":=",
"w",
".",
"Write",
"(",
"data",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"err",
":=",
"w",
".",
"Close",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"r",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"r",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"r",
".",
"Header",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"r",
".",
"setBodyReader",
"(",
"bytes",
".",
"NewReader",
"(",
"buf",
".",
"Bytes",
"(",
")",
")",
")",
"\n",
"}",
"\n",
"}"
] | // setBodyGzip gzip's the body. It accepts both strings and structs as body.
// The latter will be encoded via json.Marshal. | [
"setBodyGzip",
"gzip",
"s",
"the",
"body",
".",
"It",
"accepts",
"both",
"strings",
"and",
"structs",
"as",
"body",
".",
"The",
"latter",
"will",
"be",
"encoded",
"via",
"json",
".",
"Marshal",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/request.go#L73-L105 | train |
olivere/elastic | search_shards.go | Index | func (s *SearchShardsService) Index(index ...string) *SearchShardsService {
s.index = append(s.index, index...)
return s
} | go | func (s *SearchShardsService) Index(index ...string) *SearchShardsService {
s.index = append(s.index, index...)
return s
} | [
"func",
"(",
"s",
"*",
"SearchShardsService",
")",
"Index",
"(",
"index",
"...",
"string",
")",
"*",
"SearchShardsService",
"{",
"s",
".",
"index",
"=",
"append",
"(",
"s",
".",
"index",
",",
"index",
"...",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Index sets the names of the indices to restrict the results. | [
"Index",
"sets",
"the",
"names",
"of",
"the",
"indices",
"to",
"restrict",
"the",
"results",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_shards.go#L39-L42 | train |
olivere/elastic | search_queries_multi_match.go | Field | func (q *MultiMatchQuery) Field(field string) *MultiMatchQuery {
q.fields = append(q.fields, field)
return q
} | go | func (q *MultiMatchQuery) Field(field string) *MultiMatchQuery {
q.fields = append(q.fields, field)
return q
} | [
"func",
"(",
"q",
"*",
"MultiMatchQuery",
")",
"Field",
"(",
"field",
"string",
")",
"*",
"MultiMatchQuery",
"{",
"q",
".",
"fields",
"=",
"append",
"(",
"q",
".",
"fields",
",",
"field",
")",
"\n",
"return",
"q",
"\n",
"}"
] | // Field adds a field to run the multi match against. | [
"Field",
"adds",
"a",
"field",
"to",
"run",
"the",
"multi",
"match",
"against",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_multi_match.go#L50-L53 | train |
olivere/elastic | search_queries_multi_match.go | Type | func (q *MultiMatchQuery) Type(typ string) *MultiMatchQuery {
var zero = float64(0.0)
var one = float64(1.0)
switch strings.ToLower(typ) {
default: // best_fields / boolean
q.typ = "best_fields"
q.tieBreaker = &zero
case "most_fields":
q.typ = "most_fields"
q.tieBreaker = &one
case "cross_fields":
q.typ = "cross_fields"
q.tieBreaker = &zero
case "phrase":
q.typ = "phrase"
q.tieBreaker = &zero
case "phrase_prefix":
q.typ = "phrase_prefix"
q.tieBreaker = &zero
}
return q
} | go | func (q *MultiMatchQuery) Type(typ string) *MultiMatchQuery {
var zero = float64(0.0)
var one = float64(1.0)
switch strings.ToLower(typ) {
default: // best_fields / boolean
q.typ = "best_fields"
q.tieBreaker = &zero
case "most_fields":
q.typ = "most_fields"
q.tieBreaker = &one
case "cross_fields":
q.typ = "cross_fields"
q.tieBreaker = &zero
case "phrase":
q.typ = "phrase"
q.tieBreaker = &zero
case "phrase_prefix":
q.typ = "phrase_prefix"
q.tieBreaker = &zero
}
return q
} | [
"func",
"(",
"q",
"*",
"MultiMatchQuery",
")",
"Type",
"(",
"typ",
"string",
")",
"*",
"MultiMatchQuery",
"{",
"var",
"zero",
"=",
"float64",
"(",
"0.0",
")",
"\n",
"var",
"one",
"=",
"float64",
"(",
"1.0",
")",
"\n\n",
"switch",
"strings",
".",
"ToLower",
"(",
"typ",
")",
"{",
"default",
":",
"// best_fields / boolean",
"q",
".",
"typ",
"=",
"\"",
"\"",
"\n",
"q",
".",
"tieBreaker",
"=",
"&",
"zero",
"\n",
"case",
"\"",
"\"",
":",
"q",
".",
"typ",
"=",
"\"",
"\"",
"\n",
"q",
".",
"tieBreaker",
"=",
"&",
"one",
"\n",
"case",
"\"",
"\"",
":",
"q",
".",
"typ",
"=",
"\"",
"\"",
"\n",
"q",
".",
"tieBreaker",
"=",
"&",
"zero",
"\n",
"case",
"\"",
"\"",
":",
"q",
".",
"typ",
"=",
"\"",
"\"",
"\n",
"q",
".",
"tieBreaker",
"=",
"&",
"zero",
"\n",
"case",
"\"",
"\"",
":",
"q",
".",
"typ",
"=",
"\"",
"\"",
"\n",
"q",
".",
"tieBreaker",
"=",
"&",
"zero",
"\n",
"}",
"\n",
"return",
"q",
"\n",
"}"
] | // Type can be "best_fields", "boolean", "most_fields", "cross_fields",
// "phrase", or "phrase_prefix". | [
"Type",
"can",
"be",
"best_fields",
"boolean",
"most_fields",
"cross_fields",
"phrase",
"or",
"phrase_prefix",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_multi_match.go#L64-L86 | train |
olivere/elastic | search_queries_multi_match.go | Analyzer | func (q *MultiMatchQuery) Analyzer(analyzer string) *MultiMatchQuery {
q.analyzer = analyzer
return q
} | go | func (q *MultiMatchQuery) Analyzer(analyzer string) *MultiMatchQuery {
q.analyzer = analyzer
return q
} | [
"func",
"(",
"q",
"*",
"MultiMatchQuery",
")",
"Analyzer",
"(",
"analyzer",
"string",
")",
"*",
"MultiMatchQuery",
"{",
"q",
".",
"analyzer",
"=",
"analyzer",
"\n",
"return",
"q",
"\n",
"}"
] | // Analyzer sets the analyzer to use explicitly. It defaults to use explicit
// mapping config for the field, or, if not set, the default search analyzer. | [
"Analyzer",
"sets",
"the",
"analyzer",
"to",
"use",
"explicitly",
".",
"It",
"defaults",
"to",
"use",
"explicit",
"mapping",
"config",
"for",
"the",
"field",
"or",
"if",
"not",
"set",
"the",
"default",
"search",
"analyzer",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_multi_match.go#L97-L100 | train |
olivere/elastic | search_queries_multi_match.go | PrefixLength | func (q *MultiMatchQuery) PrefixLength(prefixLength int) *MultiMatchQuery {
q.prefixLength = &prefixLength
return q
} | go | func (q *MultiMatchQuery) PrefixLength(prefixLength int) *MultiMatchQuery {
q.prefixLength = &prefixLength
return q
} | [
"func",
"(",
"q",
"*",
"MultiMatchQuery",
")",
"PrefixLength",
"(",
"prefixLength",
"int",
")",
"*",
"MultiMatchQuery",
"{",
"q",
".",
"prefixLength",
"=",
"&",
"prefixLength",
"\n",
"return",
"q",
"\n",
"}"
] | // PrefixLength for the fuzzy process. | [
"PrefixLength",
"for",
"the",
"fuzzy",
"process",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_multi_match.go#L122-L125 | train |
olivere/elastic | search_queries_multi_match.go | MaxExpansions | func (q *MultiMatchQuery) MaxExpansions(maxExpansions int) *MultiMatchQuery {
q.maxExpansions = &maxExpansions
return q
} | go | func (q *MultiMatchQuery) MaxExpansions(maxExpansions int) *MultiMatchQuery {
q.maxExpansions = &maxExpansions
return q
} | [
"func",
"(",
"q",
"*",
"MultiMatchQuery",
")",
"MaxExpansions",
"(",
"maxExpansions",
"int",
")",
"*",
"MultiMatchQuery",
"{",
"q",
".",
"maxExpansions",
"=",
"&",
"maxExpansions",
"\n",
"return",
"q",
"\n",
"}"
] | // MaxExpansions is the number of term expansions to use when using fuzzy
// or prefix type query. It defaults to unbounded so it's recommended
// to set it to a reasonable value for faster execution. | [
"MaxExpansions",
"is",
"the",
"number",
"of",
"term",
"expansions",
"to",
"use",
"when",
"using",
"fuzzy",
"or",
"prefix",
"type",
"query",
".",
"It",
"defaults",
"to",
"unbounded",
"so",
"it",
"s",
"recommended",
"to",
"set",
"it",
"to",
"a",
"reasonable",
"value",
"for",
"faster",
"execution",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_multi_match.go#L130-L133 | train |
olivere/elastic | search_queries_multi_match.go | MinimumShouldMatch | func (q *MultiMatchQuery) MinimumShouldMatch(minimumShouldMatch string) *MultiMatchQuery {
q.minimumShouldMatch = minimumShouldMatch
return q
} | go | func (q *MultiMatchQuery) MinimumShouldMatch(minimumShouldMatch string) *MultiMatchQuery {
q.minimumShouldMatch = minimumShouldMatch
return q
} | [
"func",
"(",
"q",
"*",
"MultiMatchQuery",
")",
"MinimumShouldMatch",
"(",
"minimumShouldMatch",
"string",
")",
"*",
"MultiMatchQuery",
"{",
"q",
".",
"minimumShouldMatch",
"=",
"minimumShouldMatch",
"\n",
"return",
"q",
"\n",
"}"
] | // MinimumShouldMatch represents the minimum number of optional should clauses
// to match. | [
"MinimumShouldMatch",
"represents",
"the",
"minimum",
"number",
"of",
"optional",
"should",
"clauses",
"to",
"match",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_multi_match.go#L137-L140 | train |
olivere/elastic | suggester_completion.go | Source | func (q *CompletionSuggester) Source(includeName bool) (interface{}, error) {
cs := &completionSuggesterRequest{}
if q.text != "" {
cs.Text = q.text
}
if q.prefix != "" {
cs.Prefix = q.prefix
}
if q.regex != "" {
cs.Regex = q.regex
}
suggester := make(map[string]interface{})
cs.Completion = suggester
if q.analyzer != "" {
suggester["analyzer"] = q.analyzer
}
if q.field != "" {
suggester["field"] = q.field
}
if q.size != nil {
suggester["size"] = *q.size
}
if q.shardSize != nil {
suggester["shard_size"] = *q.shardSize
}
switch len(q.contextQueries) {
case 0:
case 1:
src, err := q.contextQueries[0].Source()
if err != nil {
return nil, err
}
suggester["contexts"] = src
default:
ctxq := make(map[string]interface{})
for _, query := range q.contextQueries {
src, err := query.Source()
if err != nil {
return nil, err
}
// Merge the dictionary into ctxq
m, ok := src.(map[string]interface{})
if !ok {
return nil, errors.New("elastic: context query is not a map")
}
for k, v := range m {
ctxq[k] = v
}
}
suggester["contexts"] = ctxq
}
// Fuzzy options
if q.fuzzyOptions != nil {
src, err := q.fuzzyOptions.Source()
if err != nil {
return nil, err
}
suggester["fuzzy"] = src
}
// Regex options
if q.regexOptions != nil {
src, err := q.regexOptions.Source()
if err != nil {
return nil, err
}
suggester["regex"] = src
}
if q.skipDuplicates != nil {
suggester["skip_duplicates"] = *q.skipDuplicates
}
// TODO(oe) Add completion-suggester specific parameters here
if !includeName {
return cs, nil
}
source := make(map[string]interface{})
source[q.name] = cs
return source, nil
} | go | func (q *CompletionSuggester) Source(includeName bool) (interface{}, error) {
cs := &completionSuggesterRequest{}
if q.text != "" {
cs.Text = q.text
}
if q.prefix != "" {
cs.Prefix = q.prefix
}
if q.regex != "" {
cs.Regex = q.regex
}
suggester := make(map[string]interface{})
cs.Completion = suggester
if q.analyzer != "" {
suggester["analyzer"] = q.analyzer
}
if q.field != "" {
suggester["field"] = q.field
}
if q.size != nil {
suggester["size"] = *q.size
}
if q.shardSize != nil {
suggester["shard_size"] = *q.shardSize
}
switch len(q.contextQueries) {
case 0:
case 1:
src, err := q.contextQueries[0].Source()
if err != nil {
return nil, err
}
suggester["contexts"] = src
default:
ctxq := make(map[string]interface{})
for _, query := range q.contextQueries {
src, err := query.Source()
if err != nil {
return nil, err
}
// Merge the dictionary into ctxq
m, ok := src.(map[string]interface{})
if !ok {
return nil, errors.New("elastic: context query is not a map")
}
for k, v := range m {
ctxq[k] = v
}
}
suggester["contexts"] = ctxq
}
// Fuzzy options
if q.fuzzyOptions != nil {
src, err := q.fuzzyOptions.Source()
if err != nil {
return nil, err
}
suggester["fuzzy"] = src
}
// Regex options
if q.regexOptions != nil {
src, err := q.regexOptions.Source()
if err != nil {
return nil, err
}
suggester["regex"] = src
}
if q.skipDuplicates != nil {
suggester["skip_duplicates"] = *q.skipDuplicates
}
// TODO(oe) Add completion-suggester specific parameters here
if !includeName {
return cs, nil
}
source := make(map[string]interface{})
source[q.name] = cs
return source, nil
} | [
"func",
"(",
"q",
"*",
"CompletionSuggester",
")",
"Source",
"(",
"includeName",
"bool",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"cs",
":=",
"&",
"completionSuggesterRequest",
"{",
"}",
"\n\n",
"if",
"q",
".",
"text",
"!=",
"\"",
"\"",
"{",
"cs",
".",
"Text",
"=",
"q",
".",
"text",
"\n",
"}",
"\n",
"if",
"q",
".",
"prefix",
"!=",
"\"",
"\"",
"{",
"cs",
".",
"Prefix",
"=",
"q",
".",
"prefix",
"\n",
"}",
"\n",
"if",
"q",
".",
"regex",
"!=",
"\"",
"\"",
"{",
"cs",
".",
"Regex",
"=",
"q",
".",
"regex",
"\n",
"}",
"\n\n",
"suggester",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"cs",
".",
"Completion",
"=",
"suggester",
"\n\n",
"if",
"q",
".",
"analyzer",
"!=",
"\"",
"\"",
"{",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"q",
".",
"analyzer",
"\n",
"}",
"\n",
"if",
"q",
".",
"field",
"!=",
"\"",
"\"",
"{",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"q",
".",
"field",
"\n",
"}",
"\n",
"if",
"q",
".",
"size",
"!=",
"nil",
"{",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"*",
"q",
".",
"size",
"\n",
"}",
"\n",
"if",
"q",
".",
"shardSize",
"!=",
"nil",
"{",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"*",
"q",
".",
"shardSize",
"\n",
"}",
"\n",
"switch",
"len",
"(",
"q",
".",
"contextQueries",
")",
"{",
"case",
"0",
":",
"case",
"1",
":",
"src",
",",
"err",
":=",
"q",
".",
"contextQueries",
"[",
"0",
"]",
".",
"Source",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"src",
"\n",
"default",
":",
"ctxq",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"for",
"_",
",",
"query",
":=",
"range",
"q",
".",
"contextQueries",
"{",
"src",
",",
"err",
":=",
"query",
".",
"Source",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"// Merge the dictionary into ctxq",
"m",
",",
"ok",
":=",
"src",
".",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"m",
"{",
"ctxq",
"[",
"k",
"]",
"=",
"v",
"\n",
"}",
"\n",
"}",
"\n",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"ctxq",
"\n",
"}",
"\n\n",
"// Fuzzy options",
"if",
"q",
".",
"fuzzyOptions",
"!=",
"nil",
"{",
"src",
",",
"err",
":=",
"q",
".",
"fuzzyOptions",
".",
"Source",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"src",
"\n",
"}",
"\n\n",
"// Regex options",
"if",
"q",
".",
"regexOptions",
"!=",
"nil",
"{",
"src",
",",
"err",
":=",
"q",
".",
"regexOptions",
".",
"Source",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"src",
"\n",
"}",
"\n\n",
"if",
"q",
".",
"skipDuplicates",
"!=",
"nil",
"{",
"suggester",
"[",
"\"",
"\"",
"]",
"=",
"*",
"q",
".",
"skipDuplicates",
"\n",
"}",
"\n\n",
"// TODO(oe) Add completion-suggester specific parameters here",
"if",
"!",
"includeName",
"{",
"return",
"cs",
",",
"nil",
"\n",
"}",
"\n\n",
"source",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"source",
"[",
"q",
".",
"name",
"]",
"=",
"cs",
"\n",
"return",
"source",
",",
"nil",
"\n",
"}"
] | // Source creates the JSON data for the completion suggester. | [
"Source",
"creates",
"the",
"JSON",
"data",
"for",
"the",
"completion",
"suggester",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/suggester_completion.go#L140-L226 | train |
olivere/elastic | suggester_completion.go | MaxDeterminizedStates | func (o *FuzzyCompletionSuggesterOptions) MaxDeterminizedStates(max int) *FuzzyCompletionSuggesterOptions {
o.maxDeterminizedStates = &max
return o
} | go | func (o *FuzzyCompletionSuggesterOptions) MaxDeterminizedStates(max int) *FuzzyCompletionSuggesterOptions {
o.maxDeterminizedStates = &max
return o
} | [
"func",
"(",
"o",
"*",
"FuzzyCompletionSuggesterOptions",
")",
"MaxDeterminizedStates",
"(",
"max",
"int",
")",
"*",
"FuzzyCompletionSuggesterOptions",
"{",
"o",
".",
"maxDeterminizedStates",
"=",
"&",
"max",
"\n",
"return",
"o",
"\n",
"}"
] | // MaxDeterminizedStates is currently undocumented in Elasticsearch. It represents
// the maximum automaton states allowed for fuzzy expansion. | [
"MaxDeterminizedStates",
"is",
"currently",
"undocumented",
"in",
"Elasticsearch",
".",
"It",
"represents",
"the",
"maximum",
"automaton",
"states",
"allowed",
"for",
"fuzzy",
"expansion",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/suggester_completion.go#L284-L287 | train |
olivere/elastic | search_queries_query_string.go | NewQueryStringQuery | func NewQueryStringQuery(queryString string) *QueryStringQuery {
return &QueryStringQuery{
queryString: queryString,
fields: make([]string, 0),
fieldBoosts: make(map[string]*float64),
}
} | go | func NewQueryStringQuery(queryString string) *QueryStringQuery {
return &QueryStringQuery{
queryString: queryString,
fields: make([]string, 0),
fieldBoosts: make(map[string]*float64),
}
} | [
"func",
"NewQueryStringQuery",
"(",
"queryString",
"string",
")",
"*",
"QueryStringQuery",
"{",
"return",
"&",
"QueryStringQuery",
"{",
"queryString",
":",
"queryString",
",",
"fields",
":",
"make",
"(",
"[",
"]",
"string",
",",
"0",
")",
",",
"fieldBoosts",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"float64",
")",
",",
"}",
"\n",
"}"
] | // NewQueryStringQuery creates and initializes a new QueryStringQuery. | [
"NewQueryStringQuery",
"creates",
"and",
"initializes",
"a",
"new",
"QueryStringQuery",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L47-L53 | train |
olivere/elastic | search_queries_query_string.go | DefaultField | func (q *QueryStringQuery) DefaultField(defaultField string) *QueryStringQuery {
q.defaultField = defaultField
return q
} | go | func (q *QueryStringQuery) DefaultField(defaultField string) *QueryStringQuery {
q.defaultField = defaultField
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"DefaultField",
"(",
"defaultField",
"string",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"defaultField",
"=",
"defaultField",
"\n",
"return",
"q",
"\n",
"}"
] | // DefaultField specifies the field to run against when no prefix field
// is specified. Only relevant when not explicitly adding fields the query
// string will run against. | [
"DefaultField",
"specifies",
"the",
"field",
"to",
"run",
"against",
"when",
"no",
"prefix",
"field",
"is",
"specified",
".",
"Only",
"relevant",
"when",
"not",
"explicitly",
"adding",
"fields",
"the",
"query",
"string",
"will",
"run",
"against",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L58-L61 | train |
olivere/elastic | search_queries_query_string.go | Field | func (q *QueryStringQuery) Field(field string) *QueryStringQuery {
q.fields = append(q.fields, field)
return q
} | go | func (q *QueryStringQuery) Field(field string) *QueryStringQuery {
q.fields = append(q.fields, field)
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"Field",
"(",
"field",
"string",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"fields",
"=",
"append",
"(",
"q",
".",
"fields",
",",
"field",
")",
"\n",
"return",
"q",
"\n",
"}"
] | // Field adds a field to run the query string against. | [
"Field",
"adds",
"a",
"field",
"to",
"run",
"the",
"query",
"string",
"against",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L64-L67 | train |
olivere/elastic | search_queries_query_string.go | TieBreaker | func (q *QueryStringQuery) TieBreaker(tieBreaker float64) *QueryStringQuery {
q.tieBreaker = &tieBreaker
return q
} | go | func (q *QueryStringQuery) TieBreaker(tieBreaker float64) *QueryStringQuery {
q.tieBreaker = &tieBreaker
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"TieBreaker",
"(",
"tieBreaker",
"float64",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"tieBreaker",
"=",
"&",
"tieBreaker",
"\n",
"return",
"q",
"\n",
"}"
] | // TieBreaker is used when more than one field is used with the query string,
// and combined queries are using dismax. | [
"TieBreaker",
"is",
"used",
"when",
"more",
"than",
"one",
"field",
"is",
"used",
"with",
"the",
"query",
"string",
"and",
"combined",
"queries",
"are",
"using",
"dismax",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L85-L88 | train |
olivere/elastic | search_queries_query_string.go | Analyzer | func (q *QueryStringQuery) Analyzer(analyzer string) *QueryStringQuery {
q.analyzer = analyzer
return q
} | go | func (q *QueryStringQuery) Analyzer(analyzer string) *QueryStringQuery {
q.analyzer = analyzer
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"Analyzer",
"(",
"analyzer",
"string",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"analyzer",
"=",
"analyzer",
"\n",
"return",
"q",
"\n",
"}"
] | // Analyzer is an optional analyzer used to analyze the query string.
// Note, if a field has search analyzer defined for it, then it will be used
// automatically. Defaults to the smart search analyzer. | [
"Analyzer",
"is",
"an",
"optional",
"analyzer",
"used",
"to",
"analyze",
"the",
"query",
"string",
".",
"Note",
"if",
"a",
"field",
"has",
"search",
"analyzer",
"defined",
"for",
"it",
"then",
"it",
"will",
"be",
"used",
"automatically",
".",
"Defaults",
"to",
"the",
"smart",
"search",
"analyzer",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L107-L110 | train |
olivere/elastic | search_queries_query_string.go | QuoteAnalyzer | func (q *QueryStringQuery) QuoteAnalyzer(quoteAnalyzer string) *QueryStringQuery {
q.quoteAnalyzer = quoteAnalyzer
return q
} | go | func (q *QueryStringQuery) QuoteAnalyzer(quoteAnalyzer string) *QueryStringQuery {
q.quoteAnalyzer = quoteAnalyzer
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"QuoteAnalyzer",
"(",
"quoteAnalyzer",
"string",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"quoteAnalyzer",
"=",
"quoteAnalyzer",
"\n",
"return",
"q",
"\n",
"}"
] | // QuoteAnalyzer is an optional analyzer to be used to analyze the query string
// for phrase searches. Note, if a field has search analyzer defined for it,
// then it will be used automatically. Defaults to the smart search analyzer. | [
"QuoteAnalyzer",
"is",
"an",
"optional",
"analyzer",
"to",
"be",
"used",
"to",
"analyze",
"the",
"query",
"string",
"for",
"phrase",
"searches",
".",
"Note",
"if",
"a",
"field",
"has",
"search",
"analyzer",
"defined",
"for",
"it",
"then",
"it",
"will",
"be",
"used",
"automatically",
".",
"Defaults",
"to",
"the",
"smart",
"search",
"analyzer",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L115-L118 | train |
olivere/elastic | search_queries_query_string.go | MaxDeterminizedState | func (q *QueryStringQuery) MaxDeterminizedState(maxDeterminizedStates int) *QueryStringQuery {
q.maxDeterminizedStates = &maxDeterminizedStates
return q
} | go | func (q *QueryStringQuery) MaxDeterminizedState(maxDeterminizedStates int) *QueryStringQuery {
q.maxDeterminizedStates = &maxDeterminizedStates
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"MaxDeterminizedState",
"(",
"maxDeterminizedStates",
"int",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"maxDeterminizedStates",
"=",
"&",
"maxDeterminizedStates",
"\n",
"return",
"q",
"\n",
"}"
] | // MaxDeterminizedState protects against too-difficult regular expression queries. | [
"MaxDeterminizedState",
"protects",
"against",
"too",
"-",
"difficult",
"regular",
"expression",
"queries",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L121-L124 | train |
olivere/elastic | search_queries_query_string.go | Fuzziness | func (q *QueryStringQuery) Fuzziness(fuzziness string) *QueryStringQuery {
q.fuzziness = fuzziness
return q
} | go | func (q *QueryStringQuery) Fuzziness(fuzziness string) *QueryStringQuery {
q.fuzziness = fuzziness
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"Fuzziness",
"(",
"fuzziness",
"string",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"fuzziness",
"=",
"fuzziness",
"\n",
"return",
"q",
"\n",
"}"
] | // Fuzziness sets the edit distance for fuzzy queries. Default is "AUTO". | [
"Fuzziness",
"sets",
"the",
"edit",
"distance",
"for",
"fuzzy",
"queries",
".",
"Default",
"is",
"AUTO",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L154-L157 | train |
olivere/elastic | search_queries_query_string.go | FuzzyPrefixLength | func (q *QueryStringQuery) FuzzyPrefixLength(fuzzyPrefixLength int) *QueryStringQuery {
q.fuzzyPrefixLength = &fuzzyPrefixLength
return q
} | go | func (q *QueryStringQuery) FuzzyPrefixLength(fuzzyPrefixLength int) *QueryStringQuery {
q.fuzzyPrefixLength = &fuzzyPrefixLength
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"FuzzyPrefixLength",
"(",
"fuzzyPrefixLength",
"int",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"fuzzyPrefixLength",
"=",
"&",
"fuzzyPrefixLength",
"\n",
"return",
"q",
"\n",
"}"
] | // FuzzyPrefixLength sets the minimum prefix length for fuzzy queries.
// Default is 1. | [
"FuzzyPrefixLength",
"sets",
"the",
"minimum",
"prefix",
"length",
"for",
"fuzzy",
"queries",
".",
"Default",
"is",
"1",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L161-L164 | train |
olivere/elastic | search_queries_query_string.go | PhraseSlop | func (q *QueryStringQuery) PhraseSlop(phraseSlop int) *QueryStringQuery {
q.phraseSlop = &phraseSlop
return q
} | go | func (q *QueryStringQuery) PhraseSlop(phraseSlop int) *QueryStringQuery {
q.phraseSlop = &phraseSlop
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"PhraseSlop",
"(",
"phraseSlop",
"int",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"phraseSlop",
"=",
"&",
"phraseSlop",
"\n",
"return",
"q",
"\n",
"}"
] | // PhraseSlop sets the default slop for phrases. If zero, then exact matches
// are required. Default value is zero. | [
"PhraseSlop",
"sets",
"the",
"default",
"slop",
"for",
"phrases",
".",
"If",
"zero",
"then",
"exact",
"matches",
"are",
"required",
".",
"Default",
"value",
"is",
"zero",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L178-L181 | train |
olivere/elastic | search_queries_query_string.go | Escape | func (q *QueryStringQuery) Escape(escape bool) *QueryStringQuery {
q.escape = &escape
return q
} | go | func (q *QueryStringQuery) Escape(escape bool) *QueryStringQuery {
q.escape = &escape
return q
} | [
"func",
"(",
"q",
"*",
"QueryStringQuery",
")",
"Escape",
"(",
"escape",
"bool",
")",
"*",
"QueryStringQuery",
"{",
"q",
".",
"escape",
"=",
"&",
"escape",
"\n",
"return",
"q",
"\n",
"}"
] | // Escape performs escaping of the query string. | [
"Escape",
"performs",
"escaping",
"of",
"the",
"query",
"string",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/search_queries_query_string.go#L243-L246 | train |
olivere/elastic | indices_get_template.go | NewIndicesGetTemplateService | func NewIndicesGetTemplateService(client *Client) *IndicesGetTemplateService {
return &IndicesGetTemplateService{
client: client,
name: make([]string, 0),
}
} | go | func NewIndicesGetTemplateService(client *Client) *IndicesGetTemplateService {
return &IndicesGetTemplateService{
client: client,
name: make([]string, 0),
}
} | [
"func",
"NewIndicesGetTemplateService",
"(",
"client",
"*",
"Client",
")",
"*",
"IndicesGetTemplateService",
"{",
"return",
"&",
"IndicesGetTemplateService",
"{",
"client",
":",
"client",
",",
"name",
":",
"make",
"(",
"[",
"]",
"string",
",",
"0",
")",
",",
"}",
"\n",
"}"
] | // NewIndicesGetTemplateService creates a new IndicesGetTemplateService. | [
"NewIndicesGetTemplateService",
"creates",
"a",
"new",
"IndicesGetTemplateService",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_get_template.go#L27-L32 | train |
olivere/elastic | index.go | Ttl | func (s *IndexService) Ttl(ttl string) *IndexService {
s.ttl = ttl
return s
} | go | func (s *IndexService) Ttl(ttl string) *IndexService {
s.ttl = ttl
return s
} | [
"func",
"(",
"s",
"*",
"IndexService",
")",
"Ttl",
"(",
"ttl",
"string",
")",
"*",
"IndexService",
"{",
"s",
".",
"ttl",
"=",
"ttl",
"\n",
"return",
"s",
"\n",
"}"
] | // Ttl is an expiration time for the document. | [
"Ttl",
"is",
"an",
"expiration",
"time",
"for",
"the",
"document",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/index.go#L95-L98 | train |
olivere/elastic | index.go | Timestamp | func (s *IndexService) Timestamp(timestamp string) *IndexService {
s.timestamp = timestamp
return s
} | go | func (s *IndexService) Timestamp(timestamp string) *IndexService {
s.timestamp = timestamp
return s
} | [
"func",
"(",
"s",
"*",
"IndexService",
")",
"Timestamp",
"(",
"timestamp",
"string",
")",
"*",
"IndexService",
"{",
"s",
".",
"timestamp",
"=",
"timestamp",
"\n",
"return",
"s",
"\n",
"}"
] | // Timestamp is an explicit timestamp for the document. | [
"Timestamp",
"is",
"an",
"explicit",
"timestamp",
"for",
"the",
"document",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/index.go#L137-L140 | train |
olivere/elastic | nodes_info.go | NewNodesInfoService | func NewNodesInfoService(client *Client) *NodesInfoService {
return &NodesInfoService{
client: client,
nodeId: []string{"_all"},
metric: []string{"_all"},
}
} | go | func NewNodesInfoService(client *Client) *NodesInfoService {
return &NodesInfoService{
client: client,
nodeId: []string{"_all"},
metric: []string{"_all"},
}
} | [
"func",
"NewNodesInfoService",
"(",
"client",
"*",
"Client",
")",
"*",
"NodesInfoService",
"{",
"return",
"&",
"NodesInfoService",
"{",
"client",
":",
"client",
",",
"nodeId",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"metric",
":",
"[",
"]",
"string",
"{",
"\"",
"\"",
"}",
",",
"}",
"\n",
"}"
] | // NewNodesInfoService creates a new NodesInfoService. | [
"NewNodesInfoService",
"creates",
"a",
"new",
"NodesInfoService",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/nodes_info.go#L30-L36 | train |
olivere/elastic | nodes_info.go | Pretty | func (s *NodesInfoService) Pretty(pretty bool) *NodesInfoService {
s.pretty = pretty
return s
} | go | func (s *NodesInfoService) Pretty(pretty bool) *NodesInfoService {
s.pretty = pretty
return s
} | [
"func",
"(",
"s",
"*",
"NodesInfoService",
")",
"Pretty",
"(",
"pretty",
"bool",
")",
"*",
"NodesInfoService",
"{",
"s",
".",
"pretty",
"=",
"pretty",
"\n",
"return",
"s",
"\n",
"}"
] | // Pretty indicates whether to indent the returned JSON. | [
"Pretty",
"indicates",
"whether",
"to",
"indent",
"the",
"returned",
"JSON",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/nodes_info.go#L67-L70 | train |
olivere/elastic | nodes_info.go | HasRole | func (n *NodesInfoNode) HasRole(role string) bool {
for _, r := range n.Roles {
if r == role {
return true
}
}
return false
} | go | func (n *NodesInfoNode) HasRole(role string) bool {
for _, r := range n.Roles {
if r == role {
return true
}
}
return false
} | [
"func",
"(",
"n",
"*",
"NodesInfoNode",
")",
"HasRole",
"(",
"role",
"string",
")",
"bool",
"{",
"for",
"_",
",",
"r",
":=",
"range",
"n",
".",
"Roles",
"{",
"if",
"r",
"==",
"role",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] | // HasRole returns true if the node fulfills the given role. | [
"HasRole",
"returns",
"true",
"if",
"the",
"node",
"fulfills",
"the",
"given",
"role",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/nodes_info.go#L199-L206 | train |
olivere/elastic | indices_get_field_mapping.go | Field | func (s *IndicesGetFieldMappingService) Field(fields ...string) *IndicesGetFieldMappingService {
s.field = append(s.field, fields...)
return s
} | go | func (s *IndicesGetFieldMappingService) Field(fields ...string) *IndicesGetFieldMappingService {
s.field = append(s.field, fields...)
return s
} | [
"func",
"(",
"s",
"*",
"IndicesGetFieldMappingService",
")",
"Field",
"(",
"fields",
"...",
"string",
")",
"*",
"IndicesGetFieldMappingService",
"{",
"s",
".",
"field",
"=",
"append",
"(",
"s",
".",
"field",
",",
"fields",
"...",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Field is a list of fields. | [
"Field",
"is",
"a",
"list",
"of",
"fields",
"."
] | 0534a7b1bf47b1ccf57e905491a641709f8a623d | https://github.com/olivere/elastic/blob/0534a7b1bf47b1ccf57e905491a641709f8a623d/indices_get_field_mapping.go#L59-L62 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.