forked from olivere/elastic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing features for source filtering
One can use source filtering now in the Get API. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-get.html#get-source-filtering for details on source filtering. Examples: ```go res, err := client.Get().Index("test").Type("tweet").Id("1").FetchSource(false).Do() // res.Source should be nil here ``` ```go fsc := NewFetchSourceContext(true).Exclude("message") res, err := client.Get().Index("test").Type("tweet").Id("1").FetchSourceContext(fsc).Do() // res.Source should not be nil, but missing the "message" field ``` A more flexible approach is to use the `FetchSourceContext` also used in the Java API. See https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/search/fetch/source/FetchSourceContext.java. It is available in Elastic as well in https://github.com/olivere/elastic/blob/master/fetch_source_context.go. This commit also adds missing fields `version` and `version_type` to the Get and MGet APIs. Also fixed the fact that [1.3.8,1.4.0) and 1.4.3+ disabled Groovy scripting by default. A test in the update API will be skipped for these versions. Closes olivere#40
- Loading branch information
Showing
6 changed files
with
192 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters