From cb2448bb989c37e718f08686f43e7c85536fd9fd Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Wed, 10 Dec 2014 13:34:45 +0100 Subject: [PATCH 01/30] first gh-pages commit --- index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 000000000..01e9a5c50 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Elastic From d3747b60f4cbfca0b9a476c84d0a67baec645fac Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Wed, 10 Dec 2014 18:36:24 +0100 Subject: [PATCH 02/30] initial stab --- css/elastic.css | 123 ++++++++++ css/github-prettify-theme.css | 149 ++++++++++++ css/normalize.css | 427 ++++++++++++++++++++++++++++++++++ css/skeleton.css | 392 +++++++++++++++++++++++++++++++ favicon.ico | 0 g/alt-f4.png | Bin 0 -> 11626 bytes index.html | 275 +++++++++++++++++++++- js/elastic.js | 69 ++++++ robots.txt | 0 9 files changed, 1434 insertions(+), 1 deletion(-) create mode 100644 css/elastic.css create mode 100644 css/github-prettify-theme.css create mode 100644 css/normalize.css create mode 100644 css/skeleton.css create mode 100644 favicon.ico create mode 100644 g/alt-f4.png create mode 100644 js/elastic.js create mode 100644 robots.txt diff --git a/css/elastic.css b/css/elastic.css new file mode 100644 index 000000000..e6e25556d --- /dev/null +++ b/css/elastic.css @@ -0,0 +1,123 @@ +header { + padding: 4rem 0 3rem 0; +} + +header h1 { +} + +header p { + font-size: 2.4rem; +} + +section { + padding: 4rem 0 2em 0; +} + +section .heading, +section .description { + margin-bottom: 1.2rem; +} + +.navbar { + display: none; +} + +.code-example { + margin-bottom: 2.5rem; +} +.code-example-body { + white-space: pre; + word-wrap: break-word; +} + +.example { + position: relative; + margin-top: 4rem; +} +.example-header { + font-weight: 600; + margin-top: 1.5rem; + margin-bottom: .5rem; +} +.example-description { + margin-bottom: 1.5rem; +} + +footer { + border-top: 1px solid #eee; + margin: 6em auto; + text-align: center; + font-size: 1.4rem; +} + +footer p { + margin: 1.5em 0; +} + +footer ul { + margin: 1.5em 0; + list-style: none; + padding-left: 0px; + margin-left: -5px; +} +footer ul > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} + +@media (min-width: 550px) { +} + +@media (min-width: 750px) { + .navbar + section { + border-top-width: 0; + } + .navbar, + .navbar-spacer { + display: block; + width: 100%; + height: 6.5rem; + background: #fff; + z-index: 99; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + } + .navbar-spacer { + display: none; + } + .navbar > .container { + width: 100%; + } + .navbar-list { + list-style: none; + margin-bottom: 0; + } + .navbar-item { + position: relative; + float: left; + margin-bottom: 0; + } + .navbar-link { + font-weight: 600; + letter-spacing: .2rem; + margin-right: 2rem; + text-decoration: none; + line-height: 6.3rem; + color: #222; + } + .navbar-link.active { + color: #33C3F0; + } + .has-docked-nav .navbar { + position: fixed; + top: 0; + left: 0; + } + .has-docked-nav .navbar-spacer { + display: block; + } + .has-docked-nav .navbar > .container { + width: 80%; + } +} diff --git a/css/github-prettify-theme.css b/css/github-prettify-theme.css new file mode 100644 index 000000000..7dd0a0d7d --- /dev/null +++ b/css/github-prettify-theme.css @@ -0,0 +1,149 @@ +/* GitHub Theme */ +.prettyprint { + background: #fff; + font-family: Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace; + font-size: 1.2rem; + padding: 2.5rem 3rem; + -webkit-font-smoothing: antialiased; +} + +.pln { + color: #333333; +} + +@media screen { + .str { + color: #dd1144; + } + + .kwd { + color: #333333; + } + + .com { + color: #999988; + } + + .typ { + color: #445588; + } + + .lit { + color: #445588; + } + + .pun { + color: #333333; + } + + .opn { + color: #333333; + } + + .clo { + color: #333333; + } + + .tag { + color: navy; + } + + .atn { + color: teal; + } + + .atv { + color: #dd1144; + } + + .dec { + color: #333333; + } + + .var { + color: teal; + } + + .fun { + color: #990000; + } +} +@media print, projection { + .str { + color: #006600; + } + + .kwd { + color: #006; + font-weight: bold; + } + + .com { + color: #600; + font-style: italic; + } + + .typ { + color: #404; + font-weight: bold; + } + + .lit { + color: #004444; + } + + .pun, .opn, .clo { + color: #444400; + } + + .tag { + color: #006; + font-weight: bold; + } + + .atn { + color: #440044; + } + + .atv { + color: #006600; + } +} +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ +} + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ +} + +/* My additional styles */ + +/*li.L0, li.L1, li.L2, li.L3, +li.L5, li.L6, li.L7, li.L8 +{ list-style-type: decimal !important }*/ + +.prettyprint li { + margin-bottom: .3rem; +} \ No newline at end of file diff --git a/css/normalize.css b/css/normalize.css new file mode 100644 index 000000000..81c6f31ea --- /dev/null +++ b/css/normalize.css @@ -0,0 +1,427 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} \ No newline at end of file diff --git a/css/skeleton.css b/css/skeleton.css new file mode 100644 index 000000000..e7b7d1a0c --- /dev/null +++ b/css/skeleton.css @@ -0,0 +1,392 @@ +/* +* Skeleton V2.0 +* Copyright 2014, Dave Gamache +* www.getskeleton.com +* Free to use under the MIT license. +* http://www.opensource.org/licenses/mit-license.php +* 12/9/2014 +*/ + + +/* Table of contents +–––––––––––––––––––––––––––––––––––––––––––––––––– +- Grid +- Base Styles +- Typography +- Links +- Buttons +- Forms +- Lists +- Code +- Tables +- Spacing +- Utilities +- Clearing +- Media Queries +*/ + + +/* Grid +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +.container { + position: relative; + width: 80%; + max-width: 960px; + margin: 0 auto; + padding: 0; } +.container .column, +.container .columns { + float: left; + width: 100%; + box-sizing: border-box; } +.row { + margin-bottom: 2rem; } +.row .column:first-child, +.row .columns:first-child { + margin-left: 0; } + +/* For devices larger than 550px */ +@media (min-width: 550px) { + + .container .column, + .container .columns { + margin-left: 4%; } + + .container .one.column, + .container .one.columns { width: 4.66666666667%; } + .container .two.columns { width: 13.3333333333%; } + .container .three.columns { width: 22%; } + .container .four.columns { width: 30.6666666667%; } + .container .five.columns { width: 39.3333333333%; } + .container .six.columns { width: 48%; } + .container .seven.columns { width: 56.6666666667%; } + .container .eight.columns { width: 65.3333333333%; } + .container .nine.columns { width: 74.0%; } + .container .ten.columns { width: 82.6666666667%; } + .container .eleven.columns { width: 91.3333333333%; } + .container .twelve.columns { width: 100%; margin-left: 0; } + + .container .one-third.column { width: 30.6666666667%; } + .container .two-thirds.column { width: 65.3333333333%; } + + .container .one-half.column { width: 48%; } + + /* Offsets */ + .container .offset-by-one.column, + .container .offset-by-one.columns { margin-left: 8.66666666667%; } + .container .offset-by-two.column { margin-left: 17.3333333333%; } + .container .offset-by-three.column { margin-left: 26%; } + .container .offset-by-four.column { margin-left: 34.6666666667%; } + .container .offset-by-five.column { margin-left: 43.3333333333%; } + .container .offset-by-six.column { margin-left: 52%; } + .container .offset-by-seven.column { margin-left: 60.6666666667%; } + .container .offset-by-eight.column { margin-left: 69.3333333333%; } + .container .offset-by-nine.column { margin-left: 78.0%; } + .container .offset-by-ten.column { margin-left: 86.6666666667%; } + .container .offset-by-eleven.column { margin-left: 95.3333333333%; } + + .container .offset-by-one-third.column { margin-left: 34.6666666667%; } + .container .offset-by-two-thirds.column { margin-left: 69.3333333333%; } + + .container .offset-by-one-half.column { margin-left: 52%; } + +} + + +/* Base Styles +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +/* NOTE +html is set to 62.5% so that all the REM measurements throughout Skeleton +are based on 10px sizing. So basically 1.5rem = 15px :) */ +html { + font-size: 62.5%; } +body { + font-size: 1.5em; /* currently ems cause chrome bug misinterpreting rems on body element */ + line-height: 1.6; + font-weight: 400; + font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #222; } + + +/* Typography +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +h1, h2, h3, h4, h5, h6 { + font-weight: 300; + margin-top: 0; + margin-bottom: 2rem; } +h1 { font-size: 4.0rem; line-height: 1.2; letter-spacing: -.1rem;} +h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; } +h3 { font-size: 3.0rem; line-height: 1.3; letter-spacing: -.1rem; } +h4 { font-size: 2.4rem; line-height: 1.35; letter-spacing: -.08rem; } +h5 { font-size: 1.8rem; line-height: 1.5; letter-spacing: -.05rem; } +h6 { font-size: 1.5rem; line-height: 1.6; letter-spacing: 0; } + +/* Larger than phablet */ +@media (min-width: 550px) { + h1 { font-size: 5.0rem; } + h2 { font-size: 4.2rem; } + h3 { font-size: 3.6rem; } + h4 { font-size: 3.0rem; } + h5 { font-size: 2.4rem; } + h6 { font-size: 1.5rem; } +} + +p { + margin-top: 0; } + + +/* Links +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +a { + color: #1EAEDB; } +a:hover { + color: #0FA0CE; } + + +/* Buttons +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +.button, +button, +input[type="submit"], +input[type="reset"], +input[type="button"] { + display: inline-block; + background-color: transparent; + border-radius: 4px; + color: #555; + text-align: center; + font-size: 11px; + font-weight: 600; + text-decoration: none; + cursor: pointer; + border: 1px solid #bbb; + height: 38px; + line-height: 38px; + padding: 0 30px; + letter-spacing: .1rem; + text-transform: uppercase; + white-space: nowrap; + box-sizing: border-box; } +.button:hover, +button:hover, +input[type="submit"]:hover, +input[type="reset"]:hover, +input[type="button"]:hover, +.button:focus, +button:focus, +input[type="submit"]:focus, +input[type="reset"]:focus, +input[type="button"]:focus { + border-color: #888; + color: #333; + outline: 0; } +.button.button-primary, +button.button-primary, +input[type="submit"].button-primary, +input[type="reset"].button-primary, +input[type="button"].button-primary { + color: #FFF; + border-color: #33C3F0; + background-color: #33C3F0; } +.button.button-primary:hover, +button.button-primary:hover, +input[type="submit"].button-primary:hover, +input[type="reset"].button-primary:hover, +input[type="button"].button-primary:hover, +.button.button-primary:focus, +button.button-primary:focus, +input[type="submit"].button-primary:focus, +input[type="reset"].button-primary:focus, +input[type="button"].button-primary:focus { + background-color: #1EAEDB; + border-color: #1EAEDB; + color: #FFF; } + + +/* Forms +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +input[type="email"], +input[type="search"], +input[type="text"], +input[type="password"], +textarea, +select { + border: 1px solid #D1D1D1; + height: 36px; + padding: 6px 10px; /* The 6px vertically centers text on FF, ignored by Webkit */ + border-radius: 4px; + box-shadow: none; + background: #fff; } +/* Removes awkard default styles on some inputs */ +input[type="email"], +input[type="search"], +input[type="text"], +textarea { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} +textarea { + min-height: 65px; + padding-top: 6px; + padding-bottom: 6px; } +input[type="email"]:focus, +input[type="search"]:focus, +input[type="text"]:focus, +input[type="password"]:focus, +textarea:focus, +select:focus { + border: 1px solid #33C3F0; + outline: 0; } +label, +legend { + display: block; + font-weight: 600; + margin-bottom: .5rem; } +fieldset { + border-width: 0; + padding: 0; } +input[type="checkbox"], +input[type="radio"] { + display: inline; } +label > .label-body { + display: inline-block; + font-weight: normal; + margin-left: .5rem; } + + +/* Lists +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +ul { + list-style: circle inside; } +ol { + list-style: decimal inside; } +ol, ul { + margin-top: 0; + padding-left: 0; } +ul ul, +ul ol, +ol ol, +ol ul { + margin: 1.5rem 0 1.5rem 3rem; + font-size: 90%; } +li { + margin-bottom: 1rem; } + + +/* Code +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +code { + padding: .2rem .5rem; + margin: 0 .2rem; + font-size: 90%; + background: #F1F1F1; + border: 1px solid #E1E1E1; + border-radius: 4px; + white-space: nowrap; } +pre > code { + display: block; + padding: 1rem 1.5rem; + white-space: pre; } + + +/* Tables +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +th, +td { + padding: 12px 15px; + text-align: left; + border-bottom: 1px solid #E1E1E1; } +th:first-child, +td:first-child { + padding-left: 0; } +th:last-child, +td:last-child { + padding-right: 0; } + + +/* Spacing +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +button, +.button { + margin-bottom: 1rem; } +input, +textarea, +select, +fieldset { + margin-bottom: 1.5rem; } +pre, +blockquote, +form, +dl, +figure, +table, +p, +ul, +ol, +form { + margin-bottom: 2.5rem; } +p { + margin-top: 0; } + + + +/* Utilities +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +.u-full-width { + width: 100%; + box-sizing: border-box; } +.u-max-full-width { + max-width: 100%; + box-sizing: border-box; } +.u-pull-right { + float: right; } +.u-pull-left { + float: left; } + + +/* Misc +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +hr { + margin-top: 3rem; + margin-bottom: 3.5rem; + border-width: 0; + border-top: 1px solid #E1E1E1; +} + +/* Clearing +–––––––––––––––––––––––––––––––––––––––––––––––––– */ + +/* Self Clearing Goodness */ +.container:after, +.row:after, +.u-cf { + content: ""; + display: table; + clear: both; } + + +/* Media Queries +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +/* +Note: The best way to structure the use of media queries is to create the queries +near the relevant code. For example, if you wanted to change the styles for buttons +on small devices, paste the mobile query code up in the buttons secion and style it +there. +*/ + + +/* Larger than mobile */ +@media (min-width: 400px) {} + +/* Larger than phablet (also point when grid becomes active) */ +@media (min-width: 550px) {} + +/* Larger than tablet */ +@media (min-width: 750px) {} + +/* Larger than desktop */ +@media (min-width: 1000px) {} + +/* Larger than Desktop HD */ +@media (min-width: 1200px) {} \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/g/alt-f4.png b/g/alt-f4.png new file mode 100644 index 0000000000000000000000000000000000000000..4f5753883a0152e9f07a0336531238eafd6b27f7 GIT binary patch literal 11626 zcmc(FRa6{7x9-5;1oseNaCd^s;BFx}!3hvt2WNob1a}V_LU4iv8(f2DaF-BlaF@e> z?s>TP;lACqZm-o{U0?U!Rkf>XRn^{Kw3db<4%TZd004latR(ji06=SqI z#4ZDKn$5(7nNc?t%8t4&ao)$CBOVr6PE=h-(z*yw_e&PKI~6Pp?(HV5BZY4MB?Hh7Zn@i!8ceNPAyP3br&W_eZ~{l-2G3NkSIHyK-tC!lT z&m{t{l0z`xlcG!Gu2Wf|o1Ci(jE{%?A?ppgDWg`471Qnf3z}aivB;xF7V6dcZZ;Ki z<=DNnnx;j(lSMaGi!9%w#BLrjq;3_p1j|WcG#`wb7YcI5l@gGY_&TR-aC16LQ4CzS ztTOJR$pOGu2L8g`uk$q+0WryGuS$+^4wU8b5j=Vx0717jL)Sou>E-j|+5rqm_8YXB zBF*sjHFP*6%HUeozGXqIpT1q9kY6Xr0Wrc7b2gR;%2nzi>kE4Gb544RO>+7N{+fcF zHcby#!8~8=Y8VY^F6MzQ4(S)M+upqZSGd@xv2HOoB(2nP)y2*SS2~&~{aZC`bPlCy zP`&(g7WQBBqtFuto%r5H_VSVTHHvZPXq#u!|7Bs;Ef0Bm5@vk%L?gpVji@IhZKW2L zP?rvjw!3~kqiqza?D5NgVk$4KvNWS`F(Fg)f%>FP{B#9_Cf64m`&=ey!i>w`1+`57 zUhQU!IWtja3>UyxRVH8r8#77HXvl2hx^0ZBqybn)8v4POfKK6L^hUo;og?z7O95i8 zD_jlj)W4|!m<%#KT0V7pD5v55QF~JT^vk5OSg-9(?6CM{znKX-rp#!BblkG( zUX!~_kLN+CmUkhxSe{s}SB)d$9;QPx*o3RwAgLkm`+9SN`AWk(JQa&I?VSVg$X*(WSL6KM4RP{#JA}fp!h7VC&(8OQ@K{Pr zu?#9<&mZ*UG~}Z;pmoKvGQe5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5?lN8e&wdQ6dc!ddEt8Y>}2 zcdx{n!z7-yOEIqv)Mpv90pb}`1hCu0sQhWDRhP0BS2nf&Vbv`NW|}BD_Lg)}O#Ef+ zC|c&tv%_UD8rzF7ZzEj{V+0lM~<*8`l zhJs*=n2dJ5JRSp}h@iKR0wXKM%90-22PG$RmmE-!uNudBg{%LKUI + + + + Elastic: An Elasticsearch client for Go + + + + + + + + + + + + + +
+
+

Elastic

+

An Elasticsearch client for the Go programming language.

+
+
+ + +
+ +
+
+

Introduction

+

+ Elastic is our stab at providing a client for + Elasticsearch + to the + Go programming language. + We use it in production for over 2 years now. It has been tested + with Elasticsearch versions 0.90, 1.0, 1.1, 1.2, 1.3, and 1.4. +

+

+ The code is MIT licensed and hosted on + GitHub. + Please + report issues on GitHub. +

+
+
+

Getting Started

+

+ To use Elastic in your Go project, first go get it: +

+
go get github.com/olivere/elastic
+
+

+ Then start using it in your code. Here's a complete example: +

+
package main
+
+import (
+  "encoding/json"
+  "fmt"
+  "net/http"
+  "time"
+
+  "github.com/olivere/elastic"
+)
+
+// Tweet is a structure used for serializing/deserializing data in Elasticsearch.
+type Tweet struct {
+  User     string                `json:"user"`
+  Message  string                `json:"message"`
+  Retweets int                   `json:"retweets"`
+  Image    string                `json:"image,omitempty"`
+  Created  time.Time             `json:"created,omitempty"`
+  Tags     []string              `json:"tags,omitempty"`
+  Location string                `json:"location,omitempty"`
+  Suggest  *elastic.SuggestField `json:"suggest_field,omitempty"`
+}
+
+func main() {
+  // Obtain a client. You can provide your own HTTP client here.
+  client, err := elastic.NewClient(http.DefaultClient)
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+
+  // Ping the Elasticsearch server to get e.g. the version number
+  info, code, err := client.Ping().Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  fmt.Printf("Elasticsearch returned with code %d and version %s", code, info.Version.Number)
+
+  // Getting the ES version number is quite common, so there's a shortcut
+  esversion, err := client.ElasticsearchVersion("http://127.0.0.1:9200")
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  fmt.Printf("Elasticsearch version %s", esversion)
+
+  // Use the IndexExists service to check if a specified index exists.
+  exists, err := client.IndexExists("twitter").Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  if !exists {
+    // Create a new index.
+    createIndex, err := client.CreateIndex("twitter").Do()
+    if err != nil {
+      // Handle error
+      panic(err)
+    }
+    if !createIndex.Acknowledged {
+      // Not acknowledged
+    }
+  }
+
+  // Index a tweet (using JSON serialization)
+  tweet1 := Tweet{User: "olivere", Message: "Take Five", Retweets: 0}
+  put1, err := client.Index().
+    Index("twitter").
+    Type("tweet").
+    Id("1").
+    BodyJson(tweet1).
+    Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  fmt.Printf("Indexed tweet %s to index %s, type %s\n", put1.Id, put1.Index, put1.Type)
+
+  // Index a second tweet (by string)
+  tweet2 := `{"user" : "olivere", "message" : "It's a Raggy Waltz"}`
+  put2, err := client.Index().
+    Index("twitter").
+    Type("tweet").
+    Id("2").
+    BodyString(tweet2).
+    Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  fmt.Printf("Indexed tweet %s to index %s, type %s\n", put2.Id, put2.Index, put2.Type)
+
+  // Get tweet with specified ID
+  get1, err := client.Get().
+    Index("twitter").
+    Type("tweet").
+    Id("1").
+    Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  if get1.Found {
+    fmt.Printf("Got document %s in version %d from index %s, type %s\n", get1.Id, get1.Version, get1.Index, get1.Type)
+  }
+
+  // Flush to make sure the documents got written.
+  _, err = client.Flush().Index("twitter").Do()
+  if err != nil {
+    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
+    Debug(true).        // print request and response to stdout
+    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)
+
+  // Number of hits
+  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")
+  }
+
+  // Update a tweet by the update API of Elasticsearch.
+  // We just increment the number of retweets.
+  update, err := client.Update().Index("twitter").Type("tweet").Id("1").
+    Script("ctx._source.retweets += num").
+    ScriptParams(map[string]interface{}{"num": 1}).
+    Upsert(map[string]interface{}{"retweets": 0}).
+    Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  fmt.Printf("New version of tweet %q is now %d", update.Id, update.Version)
+
+  // ...
+
+  // Delete an index.
+  deleteIndex, err := client.DeleteIndex("twitter").Do()
+  if err != nil {
+    // Handle error
+    panic(err)
+  }
+  if !deleteIndex.Acknowledged {
+    // Not acknowledged
+  }
+}
+
+
+ + + +Fork me on GitHub + + + + diff --git a/js/elastic.js b/js/elastic.js new file mode 100644 index 000000000..a1bcb8480 --- /dev/null +++ b/js/elastic.js @@ -0,0 +1,69 @@ +$(document).ready(function() { + + // Variables + var $codeSnippets = $('.code-example-body'), + $nav = $('.navbar'), + $body = $('body'), + $window = $(window), + navOffsetTop = $nav.offset().top, + $document = $(document), + entityMap = { + // "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' + } + + function init() { + $window.on('scroll', onScroll); + $window.on('resize', resize); + $('a[href^="#"]').on('click', smoothScroll); + buildSnippets(); + } + + function smoothScroll(e) { + e.preventDefault(); + $(document).off("scroll"); + var target = this.hash, + menu = target; + $target = $(target); + $('html, body').stop().animate({ + 'scrollTop': $target.offset().top-40 + }, 0, 'swing', function () { + window.location.hash = target; + $(document).on("scroll", onScroll); + }); + } + + function resize() { + $body.removeClass('has-docked-nav'); + navOffsetTop = $nav.offset().top; + onScroll(); + } + + function onScroll() { + if(navOffsetTop < $window.scrollTop() && !$body.hasClass('has-docked-nav')) { + $body.addClass('has-docked-nav'); + } + if(navOffsetTop > $window.scrollTop() && $body.hasClass('has-docked-nav')) { + $body.removeClass('has-docked-nav'); + } + } + + function escapeHtml(string) { + return String(string).replace(/[&<>"'\/]/g, function (s) { + return entityMap[s]; + }); + } + + function buildSnippets() { + $codeSnippets.each(function() { + var newContent = escapeHtml($(this).html()); + $(this).html(newContent); + }) + } + + init(); +}); diff --git a/robots.txt b/robots.txt new file mode 100644 index 000000000..e69de29bb From 38b35fdff5f321432e56c52fe61eeec142966ac1 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Wed, 10 Dec 2014 18:38:21 +0100 Subject: [PATCH 03/30] relative URLs --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 1a4a9869e..b547de7e3 100644 --- a/index.html +++ b/index.html @@ -7,13 +7,13 @@ - - - - + + + + - +
From 75a10cc2b7ae4e996faeffddce95630e96117365 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sat, 28 Feb 2015 12:13:47 +0100 Subject: [PATCH 04/30] Update docs for v2 --- index.html | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index b547de7e3..1e140c982 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ Elastic: An Elasticsearch client for Go - + @@ -11,7 +11,7 @@ - + @@ -42,7 +42,7 @@

Introduction

Elasticsearch to the Go programming language. - We use it in production for over 2 years now. It has been tested + We use it in production since 2012. It has been tested with Elasticsearch versions 0.90, 1.0, 1.1, 1.2, 1.3, and 1.4.

@@ -50,6 +50,18 @@

Introduction

GitHub. Please report issues on GitHub. + If you want to have a deeper look and are searching for more + examples, the + wiki on GitHub + is a good place to go. +

+
Notice
+

+ The code here describes version 2 of Elastic. If you need access to + an earlier version (or find that you cannot update), don't worry. + Version is is still available via [gopkg.in](https://gopkg.in/). + Just go get -u gopkg.in/olivere/elastic.v1 and make sure + your Go import path is set to import "gopkg.in/olivere/elastic.v1".

@@ -86,8 +98,10 @@

Getting Started

} func main() { - // Obtain a client. You can provide your own HTTP client here. - client, err := elastic.NewClient(http.DefaultClient) + // Obtain a client and connect to the default Elasticsearch installation + // on 127.0.0.1:9200. Of course you can configure your client to connect + // to other hosts and configure it in various other ways. + client, err := elastic.NewClient() if err != nil { // Handle error panic(err) From d07bda5d1d48a14052dd2f13613f45296e903dd0 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sat, 28 Feb 2015 12:14:30 +0100 Subject: [PATCH 05/30] Fix typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1e140c982..2865a1510 100644 --- a/index.html +++ b/index.html @@ -59,7 +59,7 @@
Notice

The code here describes version 2 of Elastic. If you need access to an earlier version (or find that you cannot update), don't worry. - Version is is still available via [gopkg.in](https://gopkg.in/). + Version 1 is is still available via [gopkg.in](https://gopkg.in/). Just go get -u gopkg.in/olivere/elastic.v1 and make sure your Go import path is set to import "gopkg.in/olivere/elastic.v1".

From 4eefe404c6d1daae30bdbb91aae5b95d9f630ecd Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sat, 28 Feb 2015 12:15:21 +0100 Subject: [PATCH 06/30] Fix wrong markup --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 2865a1510..a7ce2ca91 100644 --- a/index.html +++ b/index.html @@ -59,7 +59,7 @@
Notice

The code here describes version 2 of Elastic. If you need access to an earlier version (or find that you cannot update), don't worry. - Version 1 is is still available via [gopkg.in](https://gopkg.in/). + Version 1 is is still available via gopkg.in. Just go get -u gopkg.in/olivere/elastic.v1 and make sure your Go import path is set to import "gopkg.in/olivere/elastic.v1".

From d21e1761a2f48afacac30a6b6aa2174557207ba6 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sun, 1 Mar 2015 10:14:21 +0100 Subject: [PATCH 07/30] Ignore some sub-directories --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..9e0e393ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/cluster-test +/generator +/tmp + From 73b687683e5e732ff53fdbc84dd40185cec887d9 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 16 Mar 2015 10:43:08 +0100 Subject: [PATCH 08/30] Update introductory example --- index.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index a7ce2ca91..1c0f83c2a 100644 --- a/index.html +++ b/index.html @@ -193,7 +193,7 @@

Getting Started

termQuery := elastic.NewTermQuery("user", "olivere") searchResult, err := client.Search(). Index("twitter"). // search in index "twitter" - Query(&termQuery). // specify the query + Query(&termQuery). // specify the query Sort("user", true). // sort by "user" field, ascending From(0).Size(10). // take documents 0-9 Debug(true). // print request and response to stdout @@ -208,7 +208,19 @@

Getting Started

// and all kinds of other information from Elasticsearch. fmt.Printf("Query took %d milliseconds\n", searchResult.TookInMillis) - // Number of hits + // 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)) { + t := item.(Tweet) + 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) @@ -218,7 +230,7 @@

Getting Started

// Deserialize hit.Source into a Tweet (could also be just a map[string]interface{}). var t Tweet - err := json.Unmarshal(*hit.Source, &t) + err := json.Unmarshal(*hit.Source, &t) if err != nil { // Deserialization failed } From 4dcef9c56b90a9a4ea6d832c47d4b3136b9eba92 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 16 Mar 2015 10:50:06 +0100 Subject: [PATCH 09/30] How do I fix the ampersands? --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1c0f83c2a..5833cefcf 100644 --- a/index.html +++ b/index.html @@ -193,7 +193,7 @@

Getting Started

termQuery := elastic.NewTermQuery("user", "olivere") searchResult, err := client.Search(). Index("twitter"). // search in index "twitter" - Query(&termQuery). // specify the query + Query(&amp;termQuery). // specify the query Sort("user", true). // sort by "user" field, ascending From(0).Size(10). // take documents 0-9 Debug(true). // print request and response to stdout @@ -230,7 +230,7 @@

Getting Started

// Deserialize hit.Source into a Tweet (could also be just a map[string]interface{}). var t Tweet - err := json.Unmarshal(*hit.Source, &t) + err := json.Unmarshal(*hit.Source, &amp;t) if err != nil { // Deserialization failed } From a6edab9b6c6c415e4187f8e130fbaeeacf0517dd Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 16 Mar 2015 10:56:42 +0100 Subject: [PATCH 10/30] Does HTML encoding with & work? --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5833cefcf..1cdcfde5f 100644 --- a/index.html +++ b/index.html @@ -193,7 +193,7 @@

Getting Started

termQuery := elastic.NewTermQuery("user", "olivere") searchResult, err := client.Search(). Index("twitter"). // search in index "twitter" - Query(&amp;termQuery). // specify the query + Query(&termQuery). // specify the query Sort("user", true). // sort by "user" field, ascending From(0).Size(10). // take documents 0-9 Debug(true). // print request and response to stdout @@ -230,7 +230,7 @@

Getting Started

// Deserialize hit.Source into a Tweet (could also be just a map[string]interface{}). var t Tweet - err := json.Unmarshal(*hit.Source, &amp;t) + err := json.Unmarshal(*hit.Source, &t) if err != nil { // Deserialization failed } From 795c016a2ffa97ce705aabddde6b750365e1684d Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 16 Mar 2015 11:01:03 +0100 Subject: [PATCH 11/30] & encoding (try #3) --- index.html | 4 ++-- js/elastic.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 1cdcfde5f..225c456ba 100644 --- a/index.html +++ b/index.html @@ -193,7 +193,7 @@

Getting Started

termQuery := elastic.NewTermQuery("user", "olivere") searchResult, err := client.Search(). Index("twitter"). // search in index "twitter" - Query(&termQuery). // specify the query + Query(&termQuery). // specify the query Sort("user", true). // sort by "user" field, ascending From(0).Size(10). // take documents 0-9 Debug(true). // print request and response to stdout @@ -230,7 +230,7 @@

Getting Started

// Deserialize hit.Source into a Tweet (could also be just a map[string]interface{}). var t Tweet - err := json.Unmarshal(*hit.Source, &t) + err := json.Unmarshal(*hit.Source, &t) if err != nil { // Deserialization failed } diff --git a/js/elastic.js b/js/elastic.js index a1bcb8480..cb4bfb127 100644 --- a/js/elastic.js +++ b/js/elastic.js @@ -8,7 +8,7 @@ $(document).ready(function() { navOffsetTop = $nav.offset().top, $document = $(document), entityMap = { - // "&": "&", + "&": "&", "<": "<", ">": ">", '"': '"', From 4287d71cbd5f11189927d6ca3020f596ee98c60b Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 16 Mar 2015 11:01:50 +0100 Subject: [PATCH 12/30] & encoding (try #4) --- js/elastic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/elastic.js b/js/elastic.js index cb4bfb127..bcb4e3135 100644 --- a/js/elastic.js +++ b/js/elastic.js @@ -8,7 +8,7 @@ $(document).ready(function() { navOffsetTop = $nav.offset().top, $document = $(document), entityMap = { - "&": "&", + //"&": "&", "<": "<", ">": ">", '"': '"', @@ -53,7 +53,7 @@ $(document).ready(function() { } function escapeHtml(string) { - return String(string).replace(/[&<>"'\/]/g, function (s) { + return String(string).replace(/[<>"'\/]/g, function (s) { return entityMap[s]; }); } From bdca37ff82bfa8be92dee9f24c9de41e98aa711c Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Mon, 4 May 2015 13:05:29 +0200 Subject: [PATCH 13/30] Debug is removed in v2 --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 225c456ba..19c893940 100644 --- a/index.html +++ b/index.html @@ -196,7 +196,6 @@

Getting Started

Query(&termQuery). // specify the query Sort("user", true). // sort by "user" field, ascending From(0).Size(10). // take documents 0-9 - Debug(true). // print request and response to stdout Pretty(true). // pretty print request and response JSON Do() // execute if err != nil { @@ -214,8 +213,9 @@

Getting Started

// over iterating the hits, see below. var ttyp Tweet for _, item := range searchResult.Each(reflect.TypeOf(ttyp)) { - t := item.(Tweet) - fmt.Printf("Tweet by %s: %s\n", t.User, t.Message) + 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()) From 60f6dcfb567ae899a4faf4ba86bf87cc8bf6b377 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sun, 19 Jul 2015 16:08:33 +0200 Subject: [PATCH 14/30] Explain version matrix and import paths Also fixes the Home link. --- index.html | 81 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 19c893940..784ca2dc8 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@

Elastic

Getting Started

- The following code targets Elasticsearch 5.x and uses Elastic 5.0. - To use Elastic 5.0 in your Go project, first go get it: + The following code targets Elasticsearch 6.x and uses Elastic 6.0. + To use Elastic 6.0 in your Go project, first go get it:

-
go get gopkg.in/olivere/elastic.v5
+    
go get github.com/olivere/elastic
 

Then start using it in your code. Here's a complete example: @@ -143,7 +157,7 @@

Getting Started

"reflect" "time" - elastic "gopkg.in/olivere/elastic.v5" + "github.com/olivere/elastic" ) // Tweet is a structure used for serializing/deserializing data in Elasticsearch. From 6d80f321a7ef5c9b5477966c88a47f18e3ec6d2d Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Thu, 11 Jan 2018 21:08:09 +0100 Subject: [PATCH 23/30] Fix link --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 6307390c4..e808336d2 100644 --- a/index.html +++ b/index.html @@ -75,7 +75,7 @@
Versions
6.0 github.com/olivere/elastic - (source • docs • changelog) + (source • docs • changelog) From 4869fc43604c48c38186c3a3611b3f8e666b3c94 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Thu, 11 Jan 2018 21:10:16 +0100 Subject: [PATCH 24/30] Fix wording --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e808336d2..b73ad5b4d 100644 --- a/index.html +++ b/index.html @@ -124,8 +124,9 @@
Versions

Notice

- The github.com/olivere/elastic - page always refers to the latest version of Elastic. + The GitHub repository at + github.com/olivere/elastic + always refers to the latest version of Elastic. If you want to use stable versions of Elastic, you should use a tagged version. Starting from Elastic 6.0, we tag released directly on github.com/olivere/elastic. You can use e.g. From b9b963a8d4cf47d9e6df9ad8e470b1b94f19ec37 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sun, 26 Aug 2018 15:52:54 +0200 Subject: [PATCH 25/30] Changes due to Go modules released in 1.11 --- index.html | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index b73ad5b4d..1ec1f2cc1 100644 --- a/index.html +++ b/index.html @@ -74,7 +74,7 @@

Versions
6.x 6.0 - github.com/olivere/elastic + github.com/olivere/elastic/v6 (source • docs • changelog) @@ -125,13 +125,19 @@
Versions
Notice

The GitHub repository at - github.com/olivere/elastic + https://github.com/olivere/elastic always refers to the latest version of Elastic. If you want to use stable versions of Elastic, you should use a tagged version. Starting from Elastic 6.0, we tag released directly on github.com/olivere/elastic. You can use e.g. dep to target a specific version of Elastic 6.x.

+

+ We also support Go modules + as released in Go 1.11 (Go 1.10.4 works fine as well). Notice that you should + use an import path of github.com/olivere/elastic/v6 for Go 1.11 and later, + directly telling Go to use version 6 of the library. +

Earlier versions of Elastic (5.x and earlier) published packages via gopkg.in as @@ -139,12 +145,12 @@

Notice

-

Getting Started

+

Getting Started

The following code targets Elasticsearch 6.x and uses Elastic 6.0. - To use Elastic 6.0 in your Go project, first go get it: + To use Elastic 6.0 in your Go 1.11 project, first go get it:

-
go get github.com/olivere/elastic
+    
go get github.com/olivere/elastic/v6
 

Then start using it in your code. Here's a complete example: @@ -158,7 +164,7 @@

Getting Started

"reflect" "time" - "github.com/olivere/elastic" + "github.com/olivere/elastic/v6" ) // Tweet is a structure used for serializing/deserializing data in Elasticsearch. @@ -383,6 +389,16 @@

Getting Started

// Not acknowledged } }
+
Notice
+

+ The code above works with Go 1.10.4 or Go 1.11+. Those versions handle + Go modules correctly. + If you're still on an earlier version of Go, change the import path from + github.com/olivere/elastic/v6 to + github.com/olivere/elastic. + For an introduction to Go modules, read e.g. + read this blog post. +

@@ -403,13 +419,5 @@

Getting Started

Fork me on GitHub - From d3ae6b5577900808c153ef581b51392907b62021 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sun, 26 Aug 2018 15:58:08 +0200 Subject: [PATCH 26/30] Clean up --- index.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 1ec1f2cc1..313198cdf 100644 --- a/index.html +++ b/index.html @@ -74,15 +74,15 @@
Versions
6.x 6.0 - github.com/olivere/elastic/v6 - (source • docs • changelog) + https://github.com/olivere/elastic + (source • docs • changelog) 5.x 5.0 - gopkg.in/olivere/elastic.v5 + https://gopkg.in/olivere/elastic.v5 (source • docs • changelog) @@ -90,7 +90,7 @@
Versions
2.x 3.0 - gopkg.in/olivere/elastic.v3 + https://gopkg.in/olivere/elastic.v3 (source • docs • changelog) @@ -98,7 +98,7 @@
Versions
1.x 2.0 - gopkg.in/olivere/elastic.v2 + https://gopkg.in/olivere/elastic.v2 (source • docs) @@ -106,7 +106,7 @@
Versions
0.9-1.3 1.0 - gopkg.in/olivere/elastic.v1 + https://gopkg.in/olivere/elastic.v1 (source • docs) @@ -135,7 +135,7 @@
Notice

We also support Go modules as released in Go 1.11 (Go 1.10.4 works fine as well). Notice that you should - use an import path of github.com/olivere/elastic/v6 for Go 1.11 and later, + use an import path of github.com/olivere/elastic/v6 for Go 1.11 and later, directly telling Go to use version 6 of the library.

@@ -394,8 +394,8 @@

Notice
The code above works with Go 1.10.4 or Go 1.11+. Those versions handle Go modules correctly. If you're still on an earlier version of Go, change the import path from - github.com/olivere/elastic/v6 to - github.com/olivere/elastic. + github.com/olivere/elastic/v6 to + github.com/olivere/elastic. For an introduction to Go modules, read e.g. read this blog post.

From 276a62c524a28a10f76e08d2e548ac869e10af77 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sun, 26 Aug 2018 16:01:07 +0200 Subject: [PATCH 27/30] Clean up --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 313198cdf..031a4cb64 100644 --- a/index.html +++ b/index.html @@ -164,7 +164,7 @@

Getting Started

"reflect" "time" - "github.com/olivere/elastic/v6" + "github.com/olivere/elastic/v6" // <- change to "github.com/olivere/elastic" for Go 1.10.2 or earlier ) // Tweet is a structure used for serializing/deserializing data in Elasticsearch. From 3514ac7f5f28ebc277aa0986b194942f8ff2698a Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sun, 26 Aug 2018 16:02:06 +0200 Subject: [PATCH 28/30] Clean up --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 031a4cb64..a9ed9390a 100644 --- a/index.html +++ b/index.html @@ -151,6 +151,11 @@

Getting Started

To use Elastic 6.0 in your Go 1.11 project, first go get it:

go get github.com/olivere/elastic/v6
+
+

+ If you're using Go 1.10.2 or earlier, do this instead: +

+
go get github.com/olivere/elastic
 

Then start using it in your code. Here's a complete example: From fdca1058f442048984ea31d18d6e0e59aad89997 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Wed, 29 Aug 2018 18:03:18 +0200 Subject: [PATCH 29/30] Revert changes to import path --- .vscode/launch.json | 21 +++++++++++++++++++++ go.sum | 12 ++++++++++++ index.html | 25 ++----------------------- 3 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 go.sum diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..85348d67e --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Attribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch", + "type": "go", + "request": "launch", + "mode": "debug", + "remotePath": "", + "port": 2345, + "host": "127.0.0.1", + "program": "${fileDirname}", + "env": {}, + "args": [], + "showLog": true + } + ] +} \ No newline at end of file diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..ad59815e6 --- /dev/null +++ b/go.sum @@ -0,0 +1,12 @@ +github.com/fortytw2/leaktest v1.2.0 h1:cj6GCiwJDH7l3tMHLjZDo0QqPtrXJiWSI9JgpeQKw+Q= +github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 h1:hp2CYQUINdZMHdvTdXtPOY2ainKl4IoMcpAXEf2xj3Q= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/index.html b/index.html index a9ed9390a..52785cf6b 100644 --- a/index.html +++ b/index.html @@ -132,12 +132,6 @@

Notice
github.com/olivere/elastic. You can use e.g. dep to target a specific version of Elastic 6.x.

-

- We also support Go modules - as released in Go 1.11 (Go 1.10.4 works fine as well). Notice that you should - use an import path of github.com/olivere/elastic/v6 for Go 1.11 and later, - directly telling Go to use version 6 of the library. -

Earlier versions of Elastic (5.x and earlier) published packages via gopkg.in as @@ -148,12 +142,7 @@

Notice

Getting Started

The following code targets Elasticsearch 6.x and uses Elastic 6.0. - To use Elastic 6.0 in your Go 1.11 project, first go get it: -

-
go get github.com/olivere/elastic/v6
-
-

- If you're using Go 1.10.2 or earlier, do this instead: + To use Elastic 6.0 in your project, first go get it:

go get github.com/olivere/elastic
 
@@ -169,7 +158,7 @@

Getting Started

"reflect" "time" - "github.com/olivere/elastic/v6" // <- change to "github.com/olivere/elastic" for Go 1.10.2 or earlier + "github.com/olivere/elastic" ) // Tweet is a structure used for serializing/deserializing data in Elasticsearch. @@ -394,16 +383,6 @@

Getting Started

// Not acknowledged } }
-
Notice
-

- The code above works with Go 1.10.4 or Go 1.11+. Those versions handle - Go modules correctly. - If you're still on an earlier version of Go, change the import path from - github.com/olivere/elastic/v6 to - github.com/olivere/elastic. - For an introduction to Go modules, read e.g. - read this blog post. -

From 49a9661a678e97f79768d34b45b93302b49e80d7 Mon Sep 17 00:00:00 2001 From: Oliver Eilhard Date: Sat, 30 Mar 2019 17:51:16 +0100 Subject: [PATCH 30/30] Prepare for version 7 --- index.html | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 52785cf6b..e3f8acf46 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@

Introduction

for the Go programming language. We use it in production since 2012. - It supports Elasticsearch versions 1.x, 2.x, 5.x and 6.0. + It supports Elasticsearch versions 1.x, 2.x, 5.x, 6.x and 7.x.

The code is MIT licensed and hosted on @@ -70,6 +70,14 @@

Versions
+ + 7.x + 7.0 + + https://github.com/olivere/elastic/v7 + (source • docs • changelog) + + 6.x 6.0 @@ -128,9 +136,20 @@
Notice
https://github.com/olivere/elastic always refers to the latest version of Elastic. If you want to use stable versions of Elastic, you should use a tagged - version. Starting from Elastic 6.0, we tag released directly on - github.com/olivere/elastic. You can use e.g. - dep to target a specific version of Elastic 6.x. + version. +

+

+ Starting with Elastic 7.0, we support Go modules. You must use an import path of + github.com/olivere/elastic/v7. Notice that you also must use a + version of Go that is compatible with Go modules (Go 1.10.3 or later). +

+

+ With Elastic 6.0 we started tagging releases directly on + github.com/olivere/elastic. So with Elastic 6.x forward, you + should also be able to use + dep. Notice however that dep still + lacks support for version numbers in import paths (see + PR #1963).

Earlier versions of Elastic (5.x and earlier) published