Elasticsearch client for Go.
Clone or download
Pull request Compare This branch is 92 commits ahead, 695 commits behind release-branch.v6.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cluster-test Fix import paths Sep 3, 2015
uritemplates use uritemplates Oct 31, 2014
.gitignore Ignore rest-api-spec test suite in /spec for now Jul 14, 2015
.travis.yml Update README as version 3.0.0 is available Oct 28, 2015
CONTRIBUTING.md doc changes Dec 10, 2014
CONTRIBUTORS Add Termvector service Dec 4, 2015
LICENSE Merge client-refactoring into master and prepare for v2 Feb 28, 2015
README.md Update README and version Dec 4, 2015
alias.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
alias_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
aliases.go Fix import paths Sep 3, 2015
aliases_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
bulk.go Fix import paths Sep 3, 2015
bulk_delete_request.go Revert "Feature/bulk delete request parent" May 15, 2016
bulk_delete_request_test.go Revert "Feature/bulk delete request parent" May 15, 2016
bulk_index_request.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
bulk_index_request_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
bulk_request.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
bulk_test.go Add Reindexer service Apr 2, 2015
bulk_update_request.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
bulk_update_request_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
canonicalize.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
canonicalize_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
clear_scroll.go Fix import paths Sep 3, 2015
clear_scroll_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
client.go Update README and version Dec 4, 2015
client_test.go Add SetSendGetBodyAs option Nov 16, 2015
cluster_health.go Fix import paths Sep 3, 2015
cluster_health_test.go WaitForStatus shortcuts Apr 30, 2015
cluster_state.go Fix import paths Sep 3, 2015
cluster_state_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
cluster_stats.go Fix import paths Sep 3, 2015
cluster_stats_test.go Add Cluster Stats API Apr 30, 2015
connection.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
count.go Merge branch 'release-branch.v2' Nov 13, 2015
count_test.go Add missing properties to Count API Nov 4, 2015
create_index.go Fix import paths Sep 3, 2015
decoder.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
decoder_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
delete.go Fix import paths Sep 3, 2015
delete_by_query.go Fix import paths Sep 3, 2015
delete_by_query_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
delete_index.go Fix import paths Sep 3, 2015
delete_mapping.go Fix import paths Sep 3, 2015
delete_mapping_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
delete_template.go Fix import paths Sep 3, 2015
delete_test.go Fail on delete without index, type, and id Jun 16, 2015
doc.go Update doc.go for new style of configuring a Client Feb 28, 2015
errors.go Handle 404 as an error on failed update Oct 30, 2015
errors_test.go Return error when response is not JSON Jul 28, 2015
example_test.go fix typo Oct 5, 2016
exists.go Fix import paths Sep 3, 2015
exists_test.go Update Exists service Aug 2, 2015
explain.go Fix import paths Sep 3, 2015
explain_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
fetch_source_context.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
fetch_source_context_test.go Add test for FSC without excludes option Nov 9, 2015
filter.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
flush.go Fix import paths Sep 3, 2015
flush_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
geo_point.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
geo_point_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
get.go Fix import paths Sep 3, 2015
get_mapping.go Fix import paths Sep 3, 2015
get_mapping_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
get_template.go Fix import paths Sep 3, 2015
get_template_test.go Add index templates API Mar 15, 2015
get_test.go Fix GetResult Fields type Apr 27, 2015
highlight.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
highlight_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
index.go Fix import paths Sep 3, 2015
index_close.go Fix import paths Sep 3, 2015
index_exists.go Fix import paths Sep 3, 2015
index_get.go Fix import paths Sep 3, 2015
index_get_settings.go Fix import paths Sep 3, 2015
index_get_settings_test.go Add Get Settings API Mar 4, 2015
index_get_test.go Index Get API is only available in 1.4+ Mar 4, 2015
index_open.go Fix import paths Sep 3, 2015
index_test.go Scan reused results from previous request Aug 26, 2015
indices_delete_template.go Fix import paths Sep 3, 2015
indices_exists_template.go Fix import paths Sep 3, 2015
indices_exists_template_test.go go vet Mar 22, 2015
indices_exists_type.go Fix import paths Sep 3, 2015
indices_exists_type_test.go Add Types Exists API Mar 18, 2015
indices_get_template.go Fix import paths Sep 3, 2015
indices_get_template_test.go Add index templates API Mar 15, 2015
indices_put_template.go Fix import paths Sep 3, 2015
indices_stats.go Fix import paths Sep 3, 2015
indices_stats_test.go Add Index Stats API Mar 19, 2015
inner_hit.go Inner Hits May 2, 2015
inner_hit_test.go Inner Hits May 2, 2015
multi_get.go Multi Get must not use underscore for 'fields' Jun 2, 2015
multi_get_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
multi_search.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
multi_search_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
nodes_info.go Fix import paths Sep 3, 2015
nodes_info_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
optimize.go Fix import paths Sep 3, 2015
optimize_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
percolate.go Fix import paths Sep 3, 2015
percolate_test.go fix percolation on an existing document Jun 24, 2015
ping.go Fix auth on ping Dec 3, 2015
ping_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
put_mapping.go Fix import paths Sep 3, 2015
put_mapping_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
put_template.go Fix import paths Sep 3, 2015
query.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
refresh.go Fix import paths Sep 3, 2015
refresh_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
reindexer.go Add size parameter to reindexer Sep 22, 2015
reindexer_test.go Add SearchSource and friends to Scan service Oct 1, 2015
request.go Add optional gzip compression setting Nov 20, 2015
rescore.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
rescorer.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
response.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
scan.go Merge branch 'release-branch.v2' Oct 2, 2015
scan_test.go Add SearchSource and friends to Scan service Oct 1, 2015
scroll.go Fix import paths Sep 3, 2015
scroll_test.go fix typo Oct 5, 2016
search.go Merge branch 'release-branch.v2' Oct 8, 2015
search_aggs.go aggs: Special handling for keyed ranges Jul 2, 2015
search_aggs_avg.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_avg_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_cardinality.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_cardinality_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_children.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_children_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_date_histogram.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_date_histogram_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_date_range.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_date_range_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_extended_stats.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_extended_stats_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_filter.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_filter_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_filters.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_filters_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_geo_bounds.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_geo_bounds_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_geo_distance.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_geo_distance_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_global.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_global_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_histogram.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_histogram_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_max.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_max_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_min.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_min_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_missing.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_missing_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_nested.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_nested_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_percentile_ranks.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_percentile_ranks_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_percentiles.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_percentiles_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_range.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_range_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_significant_terms.go Add missing properties to significant terms agg May 29, 2015
search_aggs_significant_terms_test.go Add missing properties to significant terms agg May 29, 2015
search_aggs_stats.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_stats_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_sum.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_sum_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_terms.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_terms_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_test.go aggs: Special handling for keyed ranges Jul 2, 2015
search_aggs_tophits.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_tophits_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_aggs_value_count.go Add ScriptFile to aggregations and Update API Mar 11, 2015
search_aggs_value_count_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_date_histogram.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_date_histogram_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_filter.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_filter_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_geo_distance.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_geo_distance_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_histogram.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_histogram_script.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_histogram_script_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_histogram_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_query.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_query_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_range.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_range_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_statistical.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_statistical_script.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_statistical_script_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_statistical_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_terms.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_terms_stats.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_terms_stats_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_terms_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_facets_test.go Add fields of terms_stats facet Jul 29, 2015
search_filters_and.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_and_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_bool.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_bool_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_exists.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_exists_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_geo_distance.go Add GeoDistanceFilter Mar 11, 2015
search_filters_geo_distance_test.go Add GeoDistanceFilter Mar 11, 2015
search_filters_geo_polygon.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_geo_polygon_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_has_child.go Inner Hits May 2, 2015
search_filters_has_child_test.go Inner Hits May 2, 2015
search_filters_has_parent.go Inner Hits May 2, 2015
search_filters_has_parent_test.go Inner Hits May 2, 2015
search_filters_ids.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_ids_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_limit.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_limit_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_match_all.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_match_all_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_missing.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_missing_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_nested.go Inner Hits May 2, 2015
search_filters_nested_test.go Inner Hits May 2, 2015
search_filters_not.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_not_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_or.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_or_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_prefix.go fix typo Oct 5, 2016
search_filters_prefix_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_query.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_query_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_range.go Add optional format parameter to Range query/filter Oct 1, 2015
search_filters_range_test.go Add optional format parameter to Range query/filter Oct 1, 2015
search_filters_regexp.go Add Regexp filter Jan 9, 2015
search_filters_regexp_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_term.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_term_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_terms.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_terms_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_type.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_filters_type_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_bool.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_bool_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_boosting.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_boosting_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_common.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_common_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_constant_score.go Fix constant query filename and documentation Nov 28, 2015
search_queries_constant_score_test.go Fix constant query filename and documentation Nov 28, 2015
search_queries_custom_filters_score.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_custom_score.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_dis_max.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_filtered.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_fsq.go Update function score queries to latest version Jun 17, 2015
search_queries_fsq_score_funcs.go Update function score queries to latest version Jun 17, 2015
search_queries_fsq_test.go Update function score queries to latest version Jun 17, 2015
search_queries_fuzzy.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_fuzzy_like_this.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_fuzzy_like_this_field_query.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_fuzzy_like_this_field_query_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_fuzzy_like_this_query_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_fuzzy_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_has_child.go Inner Hits May 2, 2015
search_queries_has_child_test.go Inner Hits May 2, 2015
search_queries_has_parent.go Inner Hits May 2, 2015
search_queries_has_parent_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_ids.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_ids_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_match.go use analyzer in match query Jun 2, 2015
search_queries_match_all.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_match_all_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_match_test.go search: Add test for analyzer in MatchQuery Jun 2, 2015
search_queries_more_like_this.go Update MoreLikeThisQuery Sep 24, 2015
search_queries_more_like_this_field.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_more_like_this_field_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_more_like_this_test.go Update MoreLikeThisQuery Sep 24, 2015
search_queries_multi_match.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_multi_match_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_nested.go Inner Hits May 2, 2015
search_queries_nested_test.go Inner Hits May 2, 2015
search_queries_prefix.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_prefix_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_query_string.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_query_string_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_range.go Add optional format parameter to Range query/filter Oct 1, 2015
search_queries_range_test.go Add optional format parameter to Range query/filter Oct 1, 2015
search_queries_regexp.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_regexp_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_simple_query_string.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_simple_query_string_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_template_query.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_template_query_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_term.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_term_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_terms.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_terms_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_wildcard.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_queries_wildcard_test.go Fix import paths Sep 3, 2015
search_request.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_request_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_source.go Add FetchSource/FetchSourceContext to Scan/Search Oct 2, 2015
search_source_test.go Add unit test for from/size Jul 24, 2015
search_suggester_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_templates_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
search_test.go Fix Inner Hits tests (2) May 2, 2015
sort.go Fix sort order issues Apr 5, 2015
sort_test.go Fix sort order issues Apr 5, 2015
suggest.go Fix import paths Sep 3, 2015
suggest_field.go Add context queries to SuggestField Oct 29, 2015
suggest_field_test.go Add context queries to SuggestField Oct 29, 2015
suggest_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_completion.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_completion_fuzzy.go Wrap `fuzzy` in completion suggester Jul 29, 2015
suggester_completion_fuzzy_test.go Wrap `fuzzy` in completion suggester Jul 29, 2015
suggester_completion_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_context.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_context_category.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_context_category_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_context_geo.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_context_geo_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_phrase.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_phrase_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_term.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
suggester_term_test.go Merge client-refactoring into master and prepare for v2 Feb 28, 2015
termvector.go Add Termvector service Dec 4, 2015
termvector_test.go Try to make test succeed on Travis Dec 4, 2015
update.go Merge branch 'release-branch.v2' Oct 31, 2015
update_test.go Handle 404 as an error on failed update Oct 30, 2015

README.md

Elastic

Elastic is an Elasticsearch client for the Go programming language.

Build Status Godoc license

See the wiki for additional information about Elastic.

Releases

Notice that the master branch always refers to the latest version of Elastic. If you want to use stable versions of Elastic, you should use the packages released via gopkg.in.

Here's the version matrix:

Elasticsearch version Elastic version - Package URL
2.x 3.0 gopkg.in/olivere/elastic.v3 (source doc)
1.x 2.0 gopkg.in/olivere/elastic.v2 (source doc)
0.9-1.3 1.0 gopkg.in/olivere/elastic.v1 (source doc)

Example:

You have Elasticsearch 1.7.3 installed and want to use Elastic. As listed above, you should use Elastic 2.0. So you first install Elastic 2.0.

$ go get gopkg.in/olivere/elastic.v2

Then you use it via the following import path:

import "gopkg.in/olivere/elastic.v2"

Elastic 3.0

Elastic 3.0 targets Elasticsearch 2.0 and later. Elasticsearch 2.0.0 was released on 28th October 2015.

Notice that there are a lot of breaking changes in Elasticsearch 2.0 and we used this as an opportunity to clean up and refactor Elastic as well.

Elastic 2.0

Elastic 2.0 targets Elasticsearch 1.x and published via gopkg.in/olivere/elastic.v2.

Elastic 1.0

Elastic 1.0 is deprecated. You should really update Elasticsearch and Elastic to a recent version.

However, if you cannot update for some reason, don't worry. Version 1.0 is still available. All you need to do is go-get it and change your import path as described above.

Status

We use Elastic in production since 2012. Although Elastic is quite stable from our experience, we don't have a stable API yet. The reason for this is that Elasticsearch changes quite often and at a fast pace. At this moment we focus on features, not on a stable API.

Having said that, there have been no big API changes that required you to rewrite your application big time. More often than not it's renaming APIs and adding/removing features so that we are in sync with the Elasticsearch API.

Elastic has been used in production with the following Elasticsearch versions: 0.90, 1.0-1.7. Furthermore, we use Travis CI to test Elastic with the most recent versions of Elasticsearch and Go. See the .travis.yml file for the exact matrix and Travis for the results.

Elasticsearch has quite a few features. A lot of them are not yet implemented in Elastic (see below for details). I add features and APIs as required. It's straightforward to implement missing pieces. I'm accepting pull requests :-)

Having said that, I hope you find the project useful.

Usage

The first thing you do is to create a Client. The client connects to Elasticsearch on http://127.0.0.1:9200 by default.

You typically create one client for your app. Here's a complete example.

// Create a client
client, err := elastic.NewClient()
if err != nil {
    // Handle error
}

// Create an index
_, err = client.CreateIndex("twitter").Do()
if err != nil {
    // Handle error
    panic(err)
}

// Add a document to the index
tweet := Tweet{User: "olivere", Message: "Take Five"}
_, err = client.Index().
    Index("twitter").
    Type("tweet").
    Id("1").
    BodyJson(tweet).
    Do()
if err != nil {
    // Handle error
    panic(err)
}

// Search with a term query
termQuery := elastic.NewTermQuery("user", "olivere")
searchResult, err := client.Search().
    Index("twitter").   // search in index "twitter"
    Query(&termQuery).  // specify the query
    Sort("user", true). // sort by "user" field, ascending
    From(0).Size(10).   // take documents 0-9
    Pretty(true).       // pretty print request and response JSON
    Do()                // execute
if err != nil {
    // Handle error
    panic(err)
}

// searchResult is of type SearchResult and returns hits, suggestions,
// and all kinds of other information from Elasticsearch.
fmt.Printf("Query took %d milliseconds\n", searchResult.TookInMillis)

// Each is a convenience function that iterates over hits in a search result.
// It makes sure you don't need to check for nil values in the response.
// However, it ignores errors in serialization. If you want full control
// over iterating the hits, see below.
var ttyp Tweet
for _, item := range searchResult.Each(reflect.TypeOf(ttyp)) {
    if t, ok := item.(Tweet); ok {
        fmt.Printf("Tweet by %s: %s\n", t.User, t.Message)
    }
}
// TotalHits is another convenience function that works even when something goes wrong.
fmt.Printf("Found a total of %d tweets\n", searchResult.TotalHits())

// Here's how you iterate through results with full control over each step.
if searchResult.Hits != nil {
    fmt.Printf("Found a total of %d tweets\n", searchResult.Hits.TotalHits)

    // Iterate through results
    for _, hit := range searchResult.Hits.Hits {
        // hit.Index contains the name of the index

        // Deserialize hit.Source into a Tweet (could also be just a map[string]interface{}).
        var t Tweet
        err := json.Unmarshal(*hit.Source, &t)
        if err != nil {
            // Deserialization failed
        }

        // Work with tweet
        fmt.Printf("Tweet by %s: %s\n", t.User, t.Message)
    }
} else {
    // No hits
    fmt.Print("Found no tweets\n")
}

// Delete the index again
_, err = client.DeleteIndex("twitter").Do()
if err != nil {
    // Handle error
    panic(err)
}

See the wiki for more details.

API Status

Here's the current API status.

APIs

  • Search (most queries, filters, facets, aggregations etc. are implemented: see below)
  • Index
  • Get
  • Delete
  • Delete By Query
  • Update
  • Multi Get
  • Bulk
  • Bulk UDP
  • Term vectors
  • Multi term vectors
  • Count
  • Validate
  • Explain
  • Search
  • Search shards
  • Search template
  • Facets (most are implemented, see below)
  • Aggregates (most are implemented, see below)
  • Multi Search
  • Percolate
  • More like this
  • Benchmark

Indices

  • Create index
  • Delete index
  • Get index
  • Indices exists
  • Open/close index
  • Put mapping
  • Get mapping
  • Get field mapping
  • Types exist
  • Delete mapping
  • Index aliases
  • Update indices settings
  • Get settings
  • Analyze
  • Index templates
  • Warmers
  • Status
  • Indices stats
  • Indices segments
  • Indices recovery
  • Clear cache
  • Flush
  • Refresh
  • Optimize
  • Upgrade

Snapshot and Restore

  • Snapshot
  • Restore
  • Snapshot status
  • Monitoring snapshot/restore progress
  • Partial restore

Cat APIs

Not implemented. Those are better suited for operating with Elasticsearch on the command line.

Cluster

  • Health
  • State
  • Stats
  • Pending cluster tasks
  • Cluster reroute
  • Cluster update settings
  • Nodes stats
  • Nodes info
  • Nodes hot_threads
  • Nodes shutdown

Search

  • Inner hits (for ES >= 1.5.0; see docs)

Query DSL

Queries

  • match
  • multi_match
  • bool
  • boosting
  • common_terms
  • constant_score
  • dis_max
  • filtered
  • fuzzy_like_this_query (flt)
  • fuzzy_like_this_field_query (flt_field)
  • function_score
  • fuzzy
  • geo_shape
  • has_child
  • has_parent
  • ids
  • indices
  • match_all
  • mlt
  • mlt_field
  • nested
  • prefix
  • query_string
  • simple_query_string
  • range
  • regexp
  • span_first
  • span_multi_term
  • span_near
  • span_not
  • span_or
  • span_term
  • term
  • terms
  • top_children
  • wildcard
  • minimum_should_match
  • multi_term_query_rewrite
  • template_query

Filters

  • and
  • bool
  • exists
  • geo_bounding_box
  • geo_distance
  • geo_distance_range
  • geo_polygon
  • geoshape
  • geohash
  • has_child
  • has_parent
  • ids
  • indices
  • limit
  • match_all
  • missing
  • nested
  • not
  • or
  • prefix
  • query
  • range
  • regexp
  • script
  • term
  • terms
  • type

Facets

  • Terms
  • Range
  • Histogram
  • Date Histogram
  • Filter
  • Query
  • Statistical
  • Terms Stats
  • Geo Distance

Aggregations

  • min
  • max
  • sum
  • avg
  • stats
  • extended stats
  • value count
  • percentiles
  • percentile ranks
  • cardinality
  • geo bounds
  • top hits
  • scripted metric
  • global
  • filter
  • filters
  • missing
  • nested
  • reverse nested
  • children
  • terms
  • significant terms
  • range
  • date range
  • ipv4 range
  • histogram
  • date histogram
  • geo distance
  • geohash grid

Sorting

  • Sort by score
  • Sort by field
  • Sort by geo distance
  • Sort by script

Scan

Scrolling through documents (e.g. search_type=scan) are implemented via the Scroll and Scan services. The ClearScroll API is implemented as well.

How to contribute

Read the contribution guidelines.

Credits

Thanks a lot for the great folks working hard on Elasticsearch and Go.

LICENSE

MIT-LICENSE. See LICENSE or the LICENSE file provided in the repository for details.