Skip to content

Commit 821ef33

Browse files
authored
Merge pull request #248 from ropensci/r6-conn
R6 connection done
2 parents a5053c2 + 551190b commit 821ef33

File tree

233 files changed

+26896
-3499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+26896
-3499
lines changed

.Rbuildignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ notes-v2.md
1616
.github
1717
^codemeta\.json$
1818
^LICENSE\.md$
19-
19+
^_pkgdown\.yml$
20+
^docs$

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ matrix:
3939
- os: linux
4040
r: release
4141
env: ES_VERSION=6.5.3 R_CODECOV=true
42+
- os: linux
43+
r: release
44+
env: ES_VERSION=7.0.0-alpha2
4245

4346
r_binary_packages:
4447
- covr
@@ -91,6 +94,11 @@ before_install:
9194
export ES_VERSION=6.5.3 ;
9295
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.deb && sudo dpkg -i --force-confnew elasticsearch-$ES_VERSION.deb && sudo service elasticsearch start
9396
;;
97+
98+
"7.0.0-alpha2")
99+
export ES_VERSION=7.0.0-alpha2 ;
100+
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.deb && sudo dpkg -i --force-confnew elasticsearch-$ES_VERSION.deb && sudo service elasticsearch start
101+
;;
94102
esac
95103

96104
- sleep 3

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor
2121
opening an issue or contacting one or more of the project maintainers.
2222

2323
This Code of Conduct is adapted from the Contributor Covenant
24-
(http:contributor-covenant.org), version 1.0.0, available at
25-
http://contributor-covenant.org/version/1/0/0/
24+
(https://contributor-covenant.org), version 1.0.0, available at
25+
https://contributor-covenant.org/version/1/0/0/

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Description: Connect to 'Elasticsearch', a 'NoSQL' database built on the 'Java'
88
requests. In addition, 'elastic' provides functions for interacting with API's
99
for 'indices', documents, nodes, clusters, an interface to the cat API, and
1010
more.
11-
Version: 0.8.4.9410
11+
Version: 1.0.0
1212
License: MIT + file LICENSE
1313
Authors@R: person("Scott", "Chamberlain", role = c("aut", "cre"),
1414
email = "[email protected]")
@@ -20,12 +20,12 @@ Encoding: UTF-8
2020
Language: en-US
2121
Imports:
2222
utils,
23-
methods,
24-
httr (>= 1.2.1),
2523
curl (>= 2.2),
26-
jsonlite (>= 1.1)
24+
crul (>= 0.7.0),
25+
jsonlite (>= 1.1),
26+
R6
2727
Suggests:
28-
roxygen2 (>= 6.1.0),
28+
roxygen2 (>= 6.1.1),
2929
knitr,
3030
testthat
3131
RoxygenNote: 6.1.1

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2018
1+
YEAR: 2019
22
COPYRIGHT HOLDER: Scott Chamberlain

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018, Scott Chamberlain
1+
Copyright (c) 2019, Scott Chamberlain
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ all: move rmd2md
22

33
vignettes:
44
cd inst/vign;\
5-
Rscript -e 'library(knitr); knit("search.Rmd"); knit("elastic_intro.Rmd")'
5+
Rscript -e 'library(knitr); knit("search.Rmd"); knit("elastic.Rmd")'
66

77
move:
88
cp inst/vign/search.md vignettes;\
9-
cp inst/vign/elastic_intro.md vignettes
9+
cp inst/vign/elastic.md vignettes
1010

1111
rmd2md:
1212
cd vignettes;\
1313
mv search.md search.Rmd;\
14-
mv elastic_intro.md elastic_intro.Rmd
14+
mv elastic.md elastic.Rmd

NAMESPACE

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ S3method(docs_bulk,character)
44
S3method(docs_bulk,data.frame)
55
S3method(docs_bulk,default)
66
S3method(docs_bulk,list)
7+
S3method(docs_bulk_create,data.frame)
8+
S3method(docs_bulk_create,default)
9+
S3method(docs_bulk_delete,data.frame)
10+
S3method(docs_bulk_delete,default)
11+
S3method(docs_bulk_index,data.frame)
12+
S3method(docs_bulk_index,default)
713
S3method(docs_bulk_prep,data.frame)
814
S3method(docs_bulk_prep,default)
915
S3method(docs_bulk_prep,list)
@@ -21,7 +27,6 @@ S3method(es_parse,elastic_stats)
2127
S3method(es_parse,elastic_status)
2228
S3method(es_parse,es_GET)
2329
S3method(es_parse,index_delete)
24-
S3method(print,es_conn)
2530
S3method(scroll,character)
2631
S3method(scroll,default)
2732
S3method(scroll,list)
@@ -61,16 +66,20 @@ export(cluster_settings)
6166
export(cluster_state)
6267
export(cluster_stats)
6368
export(connect)
64-
export(connection)
6569
export(count)
6670
export(docs_bulk)
71+
export(docs_bulk_create)
72+
export(docs_bulk_delete)
73+
export(docs_bulk_index)
6774
export(docs_bulk_prep)
6875
export(docs_bulk_update)
6976
export(docs_create)
7077
export(docs_delete)
78+
export(docs_delete_by_query)
7179
export(docs_get)
7280
export(docs_mget)
7381
export(docs_update)
82+
export(docs_update_by_query)
7483
export(es_parse)
7584
export(explain)
7685
export(field_caps)
@@ -116,6 +125,7 @@ export(percolate_list)
116125
export(percolate_match)
117126
export(percolate_register)
118127
export(ping)
128+
export(pipeline_attachment)
119129
export(pipeline_create)
120130
export(pipeline_delete)
121131
export(pipeline_get)
@@ -129,23 +139,14 @@ export(tasks_cancel)
129139
export(termvectors)
130140
export(tokenizer_set)
131141
export(type_exists)
142+
export(type_remover)
132143
export(validate)
144+
importFrom(R6,R6Class)
145+
importFrom(crul,HttpClient)
146+
importFrom(crul,upload)
133147
importFrom(curl,curl_escape)
134-
importFrom(httr,DELETE)
135-
importFrom(httr,GET)
136-
importFrom(httr,HEAD)
137-
importFrom(httr,POST)
138-
importFrom(httr,PUT)
139-
importFrom(httr,add_headers)
140-
importFrom(httr,authenticate)
141-
importFrom(httr,content)
142-
importFrom(httr,content_type_json)
143-
importFrom(httr,http_status)
144-
importFrom(httr,stop_for_status)
145-
importFrom(httr,upload_file)
146148
importFrom(jsonlite,fromJSON)
147149
importFrom(jsonlite,toJSON)
148-
importFrom(methods,is)
149150
importFrom(utils,URLdecode)
150151
importFrom(utils,modifyList)
151152
importFrom(utils,read.delim)

NEWS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
elastic 1.0
2+
=============
3+
4+
### BREAKING CHANGE
5+
6+
(#87) The `connect()` function is essentially the same, with some changes, but now you pass the connection object to each function all. This indeed will break code. That's why this is a major version bump.
7+
8+
There is one very big downside to this: breaks existing code. That's the big one. I do apologize for this, but I believe that is outweighed by the upsides: passing the connection object matches behavior in similar R packages (e.g., all the SQL database clients); you can now manage as many different connection objects as you like in the same R session; having the connection object as an R6 class allows us to have some simple methods on that object to ping the server, etc. In addition, all functions will error with an informative message if you don't pass the connection object as the first thing.
9+
10+
### NEW FEATURES
11+
12+
* gains new ingest functions `pipeline_create`, `pipeline_delete`, `pipeline_get`, `pipeline_simulate`, and `pipeline_attachment()` (#191) (#226)
13+
* gains new function `docs_delete_by_query()` and `docs_update_by_query()` to delete or update multiple documents at once, respectively; and new function `reindex()` to reindex all documents from one index to another (#237) (#195)
14+
* now using `crul` for HTTP requests. this only should matter with respect to passing in curl options (#168)
15+
* recent versions of Elasticsearch are starting to include warnings in response headers for deprecations and other things. These can now be turned on or off with `connect()` (#241)
16+
* gains new functions for the bulk API: `docs_bulk_create()`, `docs_bulk_delete()`, `docs_bulk_index()`. each of which are tailored to doing the operation in the function name: creating docs, deleting docs, or indexing docs (#183)
17+
* gains new function `type_remover()` as a utility function to help users remove types from their files to use for bulk loading; could be used on example files in this package or user supplied files (#180)
18+
* gains function `alias_rename()` to rename aliases
19+
20+
### MINOR IMPROVEMENTS
21+
22+
* fixed `scroll()` example that wasn't working (#228)
23+
* rework `alias_create()` (#230)
24+
* move initialize Elasticsearch connection section of README higher up to emphasize it in the right place (#231) thanks @mbannert
25+
* whether you want "simple" or "complete" errors no longer sets env vars internally, but is passed through the internal error checker so that choices about type of errors for different connection objects do not affect one another (#242)
26+
* `docs_get` gains new parameters `source_includes` and `source_excludes` to include or exclude certain fields in the returned document (#246) thanks @Jensxy
27+
* added more examples to `index_create()` (#211)
28+
* add examples to `Search()` and `Search_uri()` docs of how to use profiles (https://www.elastic.co/guide/en/elasticsearch/reference/current/search-profile.html) (#194)
29+
* additional example added to `docs_bulk_prep()` for doing a mix of actions (i.e., delete, create, etc.)
30+
* improved examples throughout package docs so that examples are more self-contained
31+
32+
### BUG FIXES
33+
34+
* `docs_bulk_update()` was not handling boolean values correctly. now fixed (#239) (#240) thanks to @dpmccabe
35+
36+
## DEPRECATED AND DEFUNCT
37+
38+
* the `info()` method has been moved inside of the connection object. after calling `x = connect()` you can call `x$info()`
39+
* the `ping()` method has been marked as deprecated; instead, call `ping()` on the connection object created by a call to `connect()`
40+
41+
142
elastic 0.8.4
243
=============
344

0 commit comments

Comments
 (0)