From 7e1e9ac6085f6339c43c79c1c88dca49661b2788 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 11 May 2020 23:28:48 -0500 Subject: [PATCH] [docs] fix broken links in pkgdown --- docs/404.html | 160 +++++++++++++++++++++++ docs/LICENSE-text.html | 49 +++++-- docs/articles/FAQ.html | 52 ++++---- docs/articles/index.html | 50 ++++--- docs/authors.html | 43 ++++-- docs/bootstrap-toc.css | 60 +++++++++ docs/bootstrap-toc.js | 159 +++++++++++++++++++++++ docs/index.html | 146 +++++++++++---------- docs/news/index.html | 173 +++++++++++++------------ docs/pkgdown.css | 161 ++++++++++++++++++++--- docs/pkgdown.js | 15 +-- docs/pkgdown.yml | 5 +- docs/reference/chomp_aggs.html | 76 ++++++----- docs/reference/chomp_hits.html | 75 ++++++----- docs/reference/doc_shared.html | 65 ++++++---- docs/reference/es_search.html | 116 +++++++++-------- docs/reference/get_fields.html | 78 +++++------ docs/reference/index.html | 75 +++++++---- docs/reference/parse_date_time.html | 80 ++++++------ docs/reference/unpack_nested_data.html | 100 +++++++------- r-pkg/DESCRIPTION | 2 +- r-pkg/_pkgdown.yml | 8 ++ 22 files changed, 1201 insertions(+), 547 deletions(-) create mode 100644 docs/404.html create mode 100644 docs/bootstrap-toc.css create mode 100644 docs/bootstrap-toc.js diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..8e2fae1 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,160 @@ + + + + + + + + +Page not found (404) • uptasticsearch + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + +
+ + +
+

Site built with pkgdown 1.5.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 847ffda..45f9748 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -8,21 +8,29 @@ License • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -68,7 +79,7 @@ -
+
@@ -121,22 +132,32 @@

License

+ + + + + diff --git a/docs/articles/FAQ.html b/docs/articles/FAQ.html index 31a0bb8..6acb576 100644 --- a/docs/articles/FAQ.html +++ b/docs/articles/FAQ.html @@ -6,18 +6,19 @@ Frequently Asked Questions • uptasticsearch - - - + + + + + - - + - +
@@ -144,37 +146,29 @@

- +
-

Site built with pkgdown 1.3.0.

+

Site built with pkgdown 1.5.1.

+
+ diff --git a/docs/articles/index.html b/docs/articles/index.html index 1e5fada..f015d2f 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -8,21 +8,29 @@ Articles • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -68,7 +79,7 @@ -
+
@@ -118,26 +129,31 @@

Articles

All vignettes

- +
+
Frequently Asked Questions
+
+
+ + + diff --git a/docs/authors.html b/docs/authors.html index 3364461..461a2c6 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -8,21 +8,29 @@ Authors • uptasticsearch + - + - + + + + - + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -68,7 +79,7 @@ -
+
@@ -150,19 +161,23 @@

Authors

+ + + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index 9388fc5..5b03942 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,26 +5,27 @@ -Get Data Frame Representations of 'Elasticsearch' Results • uptasticsearch - - - - +Get Data Frame Representations of Elasticsearch Results • uptasticsearch + + + + + + - - +
    @@ -94,7 +96,7 @@

    Introduction

    -

    uptasticsearch tackles the issue of getting data out of Elasticsearch and into a tabular format in R and Python. It should work for all versions of Elasticsearch from 1.0.0 onwards, but is not regularly tested against all of them. If you run into a problem, please open an issue.

    +

    uptasticsearch tackles the issue of getting data out of Elasticsearch and into a tabular format in R and Python. It should work for all versions of Elasticsearch from 1.0.0 onwards, but is not regularly tested against all of them. If you run into a problem, please open an issue.

    @@ -117,55 +119,59 @@

    -
    +

    -How it Works +How it Works

    -

    The core functionality of this package is the es_search() function. This returns a data.table containing the parsed result of any given query. Note that this includes aggs queries.

    +

    The core functionality of this package is the es_search() function. This returns a data.table containing the parsed result of any given query. Note that this includes aggs queries.

    -
    +

    -Installation +Installation

    -
    +

    -R +R

    +

    Lifecycle Maturing

    Releases of this package can be installed from CRAN:

    -
    install.packages(
    -  'uptasticsearch'
    -  , repos = "http://cran.rstudio.com"
    -)
    +
    install.packages(
    +  'uptasticsearch'
    +  , repos = "http://cran.rstudio.com"
    +)
    +

    or from conda-forge

    +
    conda install -c conda-forge r-uptasticsearch

    To use the development version of the package, which has the newest changes, you can install directly from GitHub

    -
    devtools::install_github(
    -  "uptake/uptasticsearch"
    -  , subdir = "r-pkg"
    -)
    +
    remotes::install_github(
    +  "uptake/uptasticsearch"
    +  , subdir = "r-pkg"
    +)
    -
    +

    -Python +Python

    +

    Lifecycle Dormant

    This package is not currently available on PyPi. To build the development version from source, clone this repo, then :

    -
    cd py-pkg
    +
    cd py-pkg
     pip install .
    -
    +

    -Usage Examples +Usage Examples

    The examples presented here pertain to a fictional Elasticsearch index holding some information on a movie theater business.

    -
    +

    -Example 1: Get a Batch of Documents +Example 1: Get a Batch of Documents

    The most common use case for this package will be the case where you have an Elasticsearch query and want to get a data frame representation of many resulting documents.

    In the example below, we use uptasticsearch to look for all survey results in which customers said their satisfaction was “low” or “very low” and mentioned food in their comments.

    -
    library(uptasticsearch)
    +
    library(uptasticsearch)
     
    -# Build your query in an R string
    -qbody <- '{
    +# Build your query in an R string
    +qbody <- '{
       "query": {
         "filtered": {
           "filter": {
    @@ -191,27 +197,27 @@ 

    } } } -}' +}' -# Execute the query, parse into a data.table -commentDT <- es_search( - es_host = 'http://mydb.mycompany.com:9200' - , es_index = "survey_results" - , query_body = qbody - , scroll = "1m" - , n_cores = 4 -)

    +# Execute the query, parse into a data.table +commentDT <- es_search( + es_host = 'http://mydb.mycompany.com:9200' + , es_index = "survey_results" + , query_body = qbody + , scroll = "1m" + , n_cores = 4 +)
    -
    +

    -Example 2: Aggregation Results +Example 2: Aggregation Results

    Elasticsearch ships with a rich set of aggregations for creating summarized views of your data. uptasticsearch has built-in support for these aggregations.

    In the example below, we use uptasticsearch to create daily timeseries of summary statistics like total revenue and average payment amount.

    -
    library(uptasticsearch)
    +
    library(uptasticsearch)
     
    -# Build your query in an R string
    -qbody <- '{
    +# Build your query in an R string
    +qbody <- '{
       "query": {
         "filtered": {
           "filter": {
    @@ -243,17 +249,17 @@ 

    } }, "size": 0 -}' +}' -# Execute the query, parse result into a data.table -revenueDT <- es_search( - es_host = 'http://mydb.mycompany.com:9200' - , es_index = "transactions" - , size = 1000 - , query_body = qbody - , n_cores = 1 -)

    -

    In the example above, we used the date_histogram and extended_stats aggregations. es_search() has built-in support for many other aggregations and combinations of aggregations, with more on the way. Please see the table below for the current status of the package. Note that names of the form “agg1 - agg2” refer to the ability to handled aggregations nested inside other aggregations.

    +# Execute the query, parse result into a data.table +revenueDT <- es_search( + es_host = 'http://mydb.mycompany.com:9200' + , es_index = "transactions" + , size = 1000 + , query_body = qbody + , n_cores = 1 +)
    +

    In the example above, we used the date_histogram and extended_stats aggregations. es_search() has built-in support for many other aggregations and combinations of aggregations, with more on the way. Please see the table below for the current status of the package. Note that names of the form “agg1 - agg2” refer to the ability to handled aggregations nested inside other aggregations.

    @@ -419,13 +425,13 @@

    - + diff --git a/docs/news/index.html b/docs/news/index.html index fda4f4e..1481129 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -8,21 +8,29 @@ Changelog • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
    @@ -68,7 +79,7 @@ -
    +
    -
    -

    -uptasticsearch 0.4.0 Unreleased +
    +

    +uptasticsearch 0.4.0 2019-09-11

    -
    +

    -Features

    -
    +Features

    +

    -Added support for Elasticsearch 7.x

    +Added support for Elasticsearch 7.x

    -
    -

    -uptasticsearch 0.3.1 2019-01-30 +
    +

    +uptasticsearch 0.3.1 2019-01-30

    @@ -144,7 +155,7 @@

    Minor changes to unit tests to comply with CRAN

    • -#136 removed calls to closeAllConnections() in unit tests because they were superfluous and causing problems on certain operating systems in the CRAN check farm.
    • +#136 removed calls to closeAllConnections() in unit tests because they were superfluous and causing problems on certain operating systems in the CRAN check farm.
    @@ -152,26 +163,26 @@

    Changed strategy for removing duplicate records

    -
    -

    -uptasticsearch 0.3.0 2018-06-19 +
    +

    +uptasticsearch 0.3.0 2018-06-19

    -
    +

    -Features

    -
    +Features

    +

    -Full support for Elasticsearch 6.x

    +Full support for Elasticsearch 6.x
    • -#64 added support for Elasticsearch 6.x. The biggest change between that major version and v5.x is that as of Elasticsearch 6.x all requests issued to the Elasticsearch HTTP API must pass an explicit Content-Type header. Previous versions of Elasticsearch tried to guess the Content-Type when none was declared
    • +#64 added support for Elasticsearch 6.x. The biggest change between that major version and v5.x is that as of Elasticsearch 6.x all requests issued to the Elasticsearch HTTP API must pass an explicit Content-Type header. Previous versions of Elasticsearch tried to guess the Content-Type when none was declared
    • -#66 completed support for Elasticsearch 6.x. Elasticsearch 6.x changed the supported strategy for issuing scrolling requests. uptasticsearch will now hit the cluster to try to figure out which version of Elasticsearch it is running, then use the appropriate scrolling strategy.
    • +#66 completed support for Elasticsearch 6.x. Elasticsearch 6.x changed the supported strategy for issuing scrolling requests. uptasticsearch will now hit the cluster to try to figure out which version of Elasticsearch it is running, then use the appropriate scrolling strategy.
    @@ -182,28 +193,28 @@

    get_fields() when your index has no aliases

      -
    • previously, get_fields() broke on some legacy versions of Elasticsearch where no aliases had been created. The response on the _cat/aliases endpoint has changed from major version to major version. #66 fixed this for all major versions of Elasticsearch from 1.0 to 6.2
    • +
    • previously, get_fields() broke on some legacy versions of Elasticsearch where no aliases had been created. The response on the _cat/aliases endpoint has changed from major version to major version. #66 fixed this for all major versions of Elasticsearch from 1.0 to 6.2

    get_fields() when your index has multiple aliases

      -
    • previously, if you had multiple aliases pointing to the same physical index, get_fields() would only return one of those. As of #73, mappings for the underlying physical index will now be duplicated once per alias in the table returned by get_fields().
    • +
    • previously, if you had multiple aliases pointing to the same physical index, get_fields() would only return one of those. As of #73, mappings for the underlying physical index will now be duplicated once per alias in the table returned by get_fields().
    -
    +

    -bad parsing of Elasticsearch major version

    +bad parsing of Elasticsearch major version
      -
    • as of #64, uptasticsearch attempts to query the Elasticsearch host to figure out what major version of Elasticsearch is running there. Implementation errors in that PR led to versions being parsed incorrectly but silently passing tests. This was fixed in #66. NOTE: this only impacted the dev version of the library on Github.
    • +
    • as of #64, uptasticsearch attempts to query the Elasticsearch host to figure out what major version of Elasticsearch is running there. Implementation errors in that PR led to versions being parsed incorrectly but silently passing tests. This was fixed in #66. NOTE: this only impacted the dev version of the library on Github.

    ignore_scroll_restriction not being respected

      -
    • In previous versions of uptasticsearch, the value passed to es_search() for ignore_scroll_restriction was not actually respected. This was possible because an internal function had defaults specified, so we never caught the fact that that value wasn’t getting passed through. #66 instituted the practice of not specifying defaults on function arguments in internal functions, so similar bugs won’t be able to silently get through testing in the future.
    • +
    • In previous versions of uptasticsearch, the value passed to es_search() for ignore_scroll_restriction was not actually respected. This was possible because an internal function had defaults specified, so we never caught the fact that that value wasn’t getting passed through. #66 instituted the practice of not specifying defaults on function arguments in internal functions, so similar bugs won’t be able to silently get through testing in the future.
    @@ -212,48 +223,48 @@

    Deprecations and Removals

    • -#69 added a deprecation warning on get_counts. This function was outside the core mission of the package and exposed us unnecessarily to changes in the Elasticsearch DSL
    • +#69 added a deprecation warning on get_counts(). This function was outside the core mission of the package and exposed us unnecessarily to changes in the Elasticsearch DSL
    -
    -

    -uptasticsearch 0.2.0 2018-04-13 +
    +

    +uptasticsearch 0.2.0 2018-04-13

    -
    +

    -Features

    +Features

    Faster unpack_nested_data()

    • -#51 changed the parsing strategy for nested data and made it 9x faster than the previous implementation
    • +#51 changed the parsing strategy for nested data and made it 9x faster than the previous implementation

    Retry logic

      -
    • Functions that make HTTP calls will now use retry logic via httr::RETRY instead of one-shot POST or GET calls
    • +
    • Functions that make HTTP calls will now use retry logic via httr::RETRY instead of one-shot POST or GET calls
    -
    -

    -uptasticsearch 0.1.0 2017-08-29 +
    +

    +uptasticsearch 0.1.0 2017-08-29

    -
    +

    -Features

    +Features

    Elasticsearch metadata

    • -get_fields() returns a data.table with the names and types of all indexed fields across one or more indices
    • +get_fields() returns a data.table with the names and types of all indexed fields across one or more indices
    @@ -261,7 +272,7 @@

    Routing Temporary File Writing

    • -es_search() now accepts an intermediates_dir parameter, giving users control over the directory used for temporary I/O at query time
    • +es_search() now accepts an intermediates_dir parameter, giving users control over the directory used for temporary I/O at query time
    @@ -277,29 +288,29 @@

    -
    -

    -uptasticsearch 0.0.2 2017-07-18 +
    +

    +uptasticsearch 0.0.2 2017-07-18

    -
    +

    -Features

    +Features

    Main function

    • -es_search() executes an Elasticsearch query and gets a data.table
    • +es_search() executes an Elasticsearch query and gets a data.table
    -
    +

    -Parse raw JSON into data.table

    +Parse raw JSON into data.table

    • -chomp_aggs() converts a raw aggs JSON to data.table
    • +chomp_aggs() converts a raw aggs JSON to data.table
    • -chomp_hits() converts a raw hits JSON to data.table
    • +chomp_hits() converts a raw hits JSON to data.table
    @@ -307,9 +318,9 @@

    Utilities

    • -unpack_nested_data() deals with nested Elasticsearch data not in a tabular format
    • +unpack_nested_data() deals with nested Elasticsearch data not in a tabular format
    • -parse_date_time() parses date-times from Elasticsearch records
    • +parse_date_time() parses date-times from Elasticsearch records
    @@ -324,35 +335,31 @@

    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css index c03fb08..c01e592 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -17,12 +17,14 @@ html, body { height: 100%; } +body { + position: relative; +} + body > .container { display: flex; height: 100%; flex-direction: column; - - padding-top: 60px; } body > .container .row { @@ -69,6 +71,10 @@ summary { margin-top: calc(-60px + 1em); } +dd { + margin-left: 3em; +} + /* Section anchors ---------------------------------*/ a.anchor { @@ -102,37 +108,135 @@ a.anchor { margin-top: -40px; } -/* Static header placement on mobile devices */ -@media (max-width: 767px) { - .navbar-fixed-top { - position: absolute; - } - .navbar { - padding: 0; - } +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; } +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} /* Sidebar --------------------------*/ -#sidebar { +#pkgdown-sidebar { margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; } -#sidebar h2 { + +#pkgdown-sidebar h2 { font-size: 1.5em; margin-top: 1em; } -#sidebar h2:first-child { +#pkgdown-sidebar h2:first-child { margin-top: 0; } -#sidebar .list-unstyled li { +#pkgdown-sidebar .list-unstyled li { margin-bottom: 0.5em; } +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + .orcid { - height: 16px; + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; vertical-align: middle; } @@ -222,6 +326,19 @@ a.sourceLine:hover { visibility: visible; } +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + /* mark.js ----------------------------*/ mark { @@ -234,3 +351,17 @@ mark { .html-widget { margin-bottom: 10px; } + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index eb7e83d..7e7048f 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,18 +2,11 @@ (function($) { $(function() { - $("#sidebar") - .stick_in_parent({offset_top: 40}) - .on('sticky_kit:bottom', function(e) { - $(this).parent().css('position', 'static'); - }) - .on('sticky_kit:unbottom', function(e) { - $(this).parent().css('position', 'relative'); - }); + $('.navbar-fixed-top').headroom(); - $('body').scrollspy({ - target: '#sidebar', - offset: 60 + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); }); $('[data-toggle="tooltip"]').tooltip(); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 2e55621..520e37c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,6 +1,7 @@ -pandoc: 2.3.1 -pkgdown: 1.3.0 +pandoc: 2.9.2 +pkgdown: 1.5.1 pkgdown_sha: ~ articles: FAQ: FAQ.html +last_built: 2020-05-12T04:27Z diff --git a/docs/reference/chomp_aggs.html b/docs/reference/chomp_aggs.html index 920e525..9a0cb5a 100644 --- a/docs/reference/chomp_aggs.html +++ b/docs/reference/chomp_aggs.html @@ -6,23 +6,31 @@ -Aggs query to data.table — chomp_aggs() • uptasticsearch +Aggs query to data.table — chomp_aggs • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    -

    Given some raw JSON from an aggs query in Elasticsearch, parse the aggregations into a data.table.

    -
    chomp_aggs(aggs_json = NULL)
    - +

    Arguments

    Agg type
    +together. This can contain a JSON returned from an aggs query in +Elasticsearch, or a filepath or URL pointing at one.

    aggs_json

    A character vector. If its length is greater than 1, its elements will be pasted -together. This can contain a JSON returned from an aggs query in Elasticsearch, or -a filepath or URL pointing at one.

    - +

    Value

    A data.table representation of the result or NULL if the aggregation result is empty.

    -

    Examples

    # A sample raw result from an aggs query combining date_histogram and extended_stats: @@ -157,7 +163,7 @@

    Examp # Parse into a data.table aggDT <- chomp_aggs(aggs_json = result) -print(aggDT)

    #> dateTime num_potatoes.count num_potatoes.min +print(aggDT)
    #> dateTime num_potatoes.count num_potatoes.min #> 1: 2016-12-01T00:00:00.000Z 120 0 #> 2: 2017-01-01T00:00:00.000Z 131 0 #> num_potatoes.max num_potatoes.avg num_potatoes.sum @@ -173,32 +179,30 @@

    Examp #> 1: 13 123 #> 2: 13 134

    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/chomp_hits.html b/docs/reference/chomp_hits.html index 505629a..bab6bbf 100644 --- a/docs/reference/chomp_hits.html +++ b/docs/reference/chomp_hits.html @@ -6,23 +6,31 @@ -Hits to data.tables — chomp_hits() • uptasticsearch +Hits to data.tables — chomp_hits • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    -

    A function for converting Elasticsearch docs into R data.tables. It - uses fromJSON with flatten = TRUE to convert a + uses fromJSON with flatten = TRUE to convert a JSON into an R data.frame, and formats it into a data.table.

    -
    chomp_hits(hits_json = NULL, keep_nested_data_cols = TRUE)
    - +

    Arguments

    @@ -147,7 +154,7 @@

    Arg columns are deleted.

    - +

    Examples

    # A sample raw result from a hits query: @@ -164,8 +171,8 @@

    Examp "film":"Avengers: Infinity War","pmt_amount":12.75}]}}}]' # Chomp into a data.table -sampleChompedDT <- chomp_hits(hits_json = result, keep_nested_data_cols = TRUE)

    #> INFO [2019-09-09 21:22:29] Keeping the following nested data columns. Consider using unpack_nested_data for one: -#> details.pastPurchases
    print(sampleChompedDT)
    #> timestamp cust_name details.cust_class details.location +sampleChompedDT <- chomp_hits(hits_json = result, keep_nested_data_cols = TRUE)
    #> INFO [2020-05-11 23:27:37] Keeping the following nested data columns. Consider using unpack_nested_data for one: +#> details.pastPurchases
    print(sampleChompedDT)
    #> timestamp cust_name details.cust_class details.location #> 1: 2017-01-01 Austin big_spender chicago #> 2: 2017-02-02 James peasant chicago #> 3: 2017-03-03 Nick critic cannes @@ -178,7 +185,7 @@

    Examp # Unpack by details.pastPurchases unpackedDT <- unpack_nested_data(chomped_df = sampleChompedDT , col_to_unpack = "details.pastPurchases") -print(unpackedDT)

    #> timestamp cust_name details.cust_class details.location +print(unpackedDT)
    #> timestamp cust_name details.cust_class details.location #> 1: 2017-01-01 Austin big_spender chicago #> 2: 2017-01-01 Austin big_spender chicago #> 3: 2017-01-01 Austin big_spender chicago @@ -201,30 +208,30 @@

    Examp #> 9: Dopo la guerra (Apres la Guerre) 0.00 TRUE #> 10: Avengers: Infinity War 12.75 NA

    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/doc_shared.html b/docs/reference/doc_shared.html index 2c346a7..7b2745a 100644 --- a/docs/reference/doc_shared.html +++ b/docs/reference/doc_shared.html @@ -8,21 +8,29 @@ NULL Object For Common Documentation — doc_shared • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    -

    This is a NULL object with documentation so that later functions can call inheritParams

    -
    - +

    Arguments

    - @@ -146,31 +153,33 @@

    Arg all indexes in the cluster, set this argument to "_all".

    es_host

    A string identifying an Elasticsearch host. This should be of the form +

    A string identifying an Elasticsearch host. This should be of the form [transfer_protocol][hostname]:[port]. For example, 'http://myindex.thing.com:9200'.

    - -
    - +
    +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/es_search.html b/docs/reference/es_search.html index 545475e..6ef5ac3 100644 --- a/docs/reference/es_search.html +++ b/docs/reference/es_search.html @@ -6,23 +6,31 @@ -Execute an Elasticsearch query and get a data.table — es_search() • uptasticsearch +Execute an Elasticsearch query and get a data.table — es_search • uptasticsearch + - + - + + + + - + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    - -

    Given a query and some optional parameters, es_search() gets results +

    Given a query and some optional parameters, es_search gets results from HTTP requests to Elasticsearch and returns a data.table representation of those results.

    -
    -
    es_search(es_host, es_index, size = 10000, query_body = "{}",
    -  scroll = "5m", max_hits = Inf,
    -  n_cores = ceiling(parallel::detectCores()/2),
    -  break_on_duplicates = TRUE, ignore_scroll_restriction = FALSE,
    -  intermediates_dir = getwd())
    - +
    es_search(
    +  es_host,
    +  es_index,
    +  size = 10000,
    +  query_body = "{}",
    +  scroll = "5m",
    +  max_hits = Inf,
    +  n_cores = ceiling(parallel::detectCores()/2),
    +  break_on_duplicates = TRUE,
    +  ignore_scroll_restriction = FALSE,
    +  intermediates_dir = getwd()
    +)
    +

    Arguments

    - @@ -154,7 +168,8 @@

    Arg

    - @@ -174,7 +189,7 @@

    Arg

    - @@ -184,10 +199,11 @@

    Arg

    - + @@ -204,20 +220,20 @@

    Arg

    es_host

    A string identifying an Elasticsearch host. This should be of the form +

    A string identifying an Elasticsearch host. This should be of the form [transfer_protocol][hostname]:[port]. For example, 'http://myindex.thing.com:9200'.

    size

    Number of records per page of results. See Elasticsearch docs for more. +

    Number of records per page of results. +See Elasticsearch docs for more. Note that this will be reset to 0 if you submit a query_body with an "aggs" request in it. Also see max_hits.

    max_hits

    Integer. If specified, es_search() will stop pulling data as soon +

    Integer. If specified, es_search will stop pulling data as soon as it has pulled this many hits. Default is Inf, meaning that all possible hits will be pulled.

    break_on_duplicates

    Boolean, defaults to TRUE. es_search() uses the size of the final object it returns -to check whether or not some data were lost during the processing. -If you have duplicates in the source data, you will have to set this flag to -FALSE and just trust that no data have been lost. Sorry :( .

    Boolean, defaults to TRUE. es_search uses the size of the +final object it returns to check whether or not some data were lost +during the processing. If you have duplicates in the source data, you +will have to set this flag to FALSE and just trust that no data have +been lost. Sorry :( .

    ignore_scroll_restriction
    intermediates_dir

    When scrolling over search results, this function writes -intermediate results to disk. By default, es_search() will create a temporary +intermediate results to disk. By default, `es_search` will create a temporary directory in whatever working directory the function is called from. If you -want to change this behavior, provide a path here. es_search() will create +want to change this behavior, provide a path here. `es_search` will create and write to a temporary directory under whatever path you provide.

    - +

    References

    Elasticsearch 6 scrolling strategy

    -

    Examples

    -
    # NOT RUN {
    +    
    if (FALSE) { + ###=== Example 1: Get low-scoring food survey results ===### query_body <- '{"query":{"filtered":{"filter":{"bool":{"must":[ @@ -244,34 +260,32 @@

    Examp resultDT <- es_search(es_host = "http://es.custdb.mycompany.com:9200" , es_index = 'ticket_sales' , query_body = query_body) -# }

    +}
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/get_fields.html b/docs/reference/get_fields.html index 5451751..a4c0bdb 100644 --- a/docs/reference/get_fields.html +++ b/docs/reference/get_fields.html @@ -6,23 +6,31 @@ -Get the names and data types of the indexed fields in an index — get_fields() • uptasticsearch +Get the names and data types of the indexed fields in an index — get_fields • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    -

    For a given Elasticsearch index, return the mapping from field name to data type for all indexed fields.

    -
    get_fields(es_host, es_indices = "_all")
    - +

    Arguments

    - @@ -145,45 +152,42 @@

    Arg treated as regular expressions.

    es_host

    A string identifying an Elasticsearch host. This should be of the form +

    A string identifying an Elasticsearch host. This should be of the form [transfer_protocol][hostname]:[port]. For example, 'http://myindex.thing.com:9200'.

    - +

    Value

    A data.table containing four columns: index, type, field, and data_type

    -

    Examples

    -
    # NOT RUN {
    +    
    if (FALSE) { # get the mapping for all indexed fields in the ticket_sales and customers indices mappingDT <- get_fields(es_host = "http://es.custdb.mycompany.com:9200" - , es_indices = c("ticket_sales", "customers")) -# }
    + , es_indices = c("ticket_sales", "customers")) +}
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 9e73b96..5e92e47 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -8,21 +8,29 @@ Function reference • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
    @@ -68,7 +79,7 @@ -
    + +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/parse_date_time.html b/docs/reference/parse_date_time.html index 0e9e7cc..3e231f2 100644 --- a/docs/reference/parse_date_time.html +++ b/docs/reference/parse_date_time.html @@ -6,23 +6,31 @@ -Parse date-times from Elasticsearch records — parse_date_time() • uptasticsearch +Parse date-times from Elasticsearch records — parse_date_time • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,15 +38,15 @@ - + - + @@ -52,9 +60,10 @@ + - +
    @@ -76,7 +85,7 @@ -
    +
    -

    Given a data.table with date-time strings, this function converts those dates-times to type POSIXct with the appropriate time zone. Assumption is that dates are of the form "2016-07-25T22:15:19Z" where T is just a separator and the last letter is a military timezone.

    This is a side-effect-free function: it returns a new data.table and the input data.table is unmodified.

    -
    parse_date_time(input_df, date_cols, assume_tz = "UTC")
    - +

    Arguments

    @@ -154,23 +161,22 @@

    Arg

    Timezone to convert to if parsing fails. Default is UTC

    - +

    References

    https://www.timeanddate.com/time/zones/military

    https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

    -

    Examples

    # Sample es_search(), chomp_hits(), or chomp_aggs() output: -someDT <- data.table::data.table(id = 1:5 - , company = c("Apple", "Apple", "Banana", "Banana", "Cucumber") - , timestamp = c("2015-03-14T09:26:53B", "2015-03-14T09:26:54B" +someDT <- data.table::data.table(id = 1:5 + , company = c("Apple", "Apple", "Banana", "Banana", "Cucumber") + , timestamp = c("2015-03-14T09:26:53B", "2015-03-14T09:26:54B" , "2031-06-28T08:53:07Z", "2031-06-28T08:53:08Z" , "2000-01-01")) # Note that the date field is character right now -str(someDT)
    #> Classes ‘data.table’ and 'data.frame': 5 obs. of 3 variables: +str(someDT)
    #> Classes ‘data.table’ and 'data.frame': 5 obs. of 3 variables: #> $ id : int 1 2 3 4 5 #> $ company : chr "Apple" "Apple" "Banana" "Banana" ... #> $ timestamp: chr "2015-03-14T09:26:53B" "2015-03-14T09:26:54B" "2031-06-28T08:53:07Z" "2031-06-28T08:53:08Z" ... @@ -179,38 +185,36 @@

    Examp someDT <- parse_date_time(input_df = someDT , date_cols = "timestamp" , assume_tz = "UTC") -str(someDT)

    #> Classes ‘data.table’ and 'data.frame': 5 obs. of 3 variables: +str(someDT)
    #> Classes ‘data.table’ and 'data.frame': 5 obs. of 3 variables: #> $ id : int 1 2 3 4 5 #> $ company : chr "Apple" "Apple" "Banana" "Banana" ... #> $ timestamp: POSIXct, format: "2015-03-14 07:26:53" "2015-03-14 07:26:54" ... #> - attr(*, ".internal.selfref")=<externalptr>
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/unpack_nested_data.html b/docs/reference/unpack_nested_data.html index 2049039..e6995bd 100644 --- a/docs/reference/unpack_nested_data.html +++ b/docs/reference/unpack_nested_data.html @@ -6,23 +6,31 @@ -Unpack a nested data.table — unpack_nested_data() • uptasticsearch +Unpack a nested data.table — unpack_nested_data • uptasticsearch + - + - + + - + + + + + - + + - + - - + + + @@ -30,16 +38,16 @@ - - + - + input data.table is unmodified." /> + @@ -53,9 +61,10 @@ + - +
    @@ -77,7 +86,7 @@ -
    +
    - -

    After calling a chomp_*() function or es_search(), if - you had a nested array in the JSON, its corresponding column in the - resulting data.table is a data.frame itself (or a list of vectors). This - function expands that nested column out, adding its data to the original - data.table, and duplicating metadata down the rows as necessary.

    +

    After calling a chomp_* function or es_search, if + you had a nested array in the JSON, its corresponding column in the + resulting data.table is a data.frame itself (or a list of vectors). This + function expands that nested column out, adding its data to the original + data.table, and duplicating metadata down the rows as necessary.

    This is a side-effect-free function: it returns a new data.table and the - input data.table is unmodified.

    - + input data.table is unmodified.

    unpack_nested_data(chomped_df, col_to_unpack)
    - +

    Arguments

    @@ -148,11 +155,10 @@

    Arg

    - +
    col_to_unpack

    a character vector of length one: the column name to -unpack

    a character vector of length one: the column name to unpack

    - +

    Examples

    # A sample raw result from a hits query: @@ -169,8 +175,8 @@

    Examp "film":"Avengers: Infinity War","pmt_amount":12.75}]}}}]' # Chomp into a data.table -sampleChompedDT <- chomp_hits(hits_json = result, keep_nested_data_cols = TRUE)

    #> INFO [2019-09-09 21:22:30] Keeping the following nested data columns. Consider using unpack_nested_data for one: -#> details.pastPurchases
    print(sampleChompedDT)
    #> timestamp cust_name details.cust_class details.location +sampleChompedDT <- chomp_hits(hits_json = result, keep_nested_data_cols = TRUE)
    #> INFO [2020-05-11 23:27:38] Keeping the following nested data columns. Consider using unpack_nested_data for one: +#> details.pastPurchases
    print(sampleChompedDT)
    #> timestamp cust_name details.cust_class details.location #> 1: 2017-01-01 Austin big_spender chicago #> 2: 2017-02-02 James peasant chicago #> 3: 2017-03-03 Nick critic cannes @@ -183,7 +189,7 @@

    Examp # Unpack by details.pastPurchases unpackedDT <- unpack_nested_data(chomped_df = sampleChompedDT , col_to_unpack = "details.pastPurchases") -print(unpackedDT)

    #> timestamp cust_name details.cust_class details.location +print(unpackedDT)
    #> timestamp cust_name details.cust_class details.location #> 1: 2017-01-01 Austin big_spender chicago #> 2: 2017-01-01 Austin big_spender chicago #> 3: 2017-01-01 Austin big_spender chicago @@ -206,30 +212,30 @@

    Examp #> 9: Dopo la guerra (Apres la Guerre) 0.00 TRUE #> 10: Avengers: Infinity War 12.75 NA

    - +
    + + diff --git a/r-pkg/DESCRIPTION b/r-pkg/DESCRIPTION index ff3e66e..9330c6a 100644 --- a/r-pkg/DESCRIPTION +++ b/r-pkg/DESCRIPTION @@ -40,6 +40,6 @@ License: BSD_3_clause + file LICENSE URL: https://github.com/uptake/uptasticsearch BugReports: https://github.com/uptake/uptasticsearch/issues LazyData: TRUE -RoxygenNote: 7.0.2 +RoxygenNote: 7.1.0 VignetteBuilder: knitr Encoding: UTF-8 diff --git a/r-pkg/_pkgdown.yml b/r-pkg/_pkgdown.yml index f424195..43deccb 100644 --- a/r-pkg/_pkgdown.yml +++ b/r-pkg/_pkgdown.yml @@ -2,6 +2,14 @@ template: params: bootswatch: flatly +repo: + url: + home: https://github.com/uptake/uptasticsearch/ + source: https://github.com/uptake/uptasticsearch/tree/master/r-pkg/ + issue: https://github.com/uptake/uptasticsearch/issues + user: https://github.com/ + + reference: - title: Main function contents: