You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2015/12/22 13:05:08 UTC
incubator-zeppelin git commit: [Docs] Minor fixes for Elasticsearch
documentation
Repository: incubator-zeppelin
Updated Branches:
refs/heads/master 7e9028329 -> d4396887d
[Docs] Minor fixes for Elasticsearch documentation
### What is this PR for?
Adds elasticsearch to interpreter menu in navigation and fixes max image size for screenshots
### What type of PR is it?
Documentation | Hot Fix
### Is there a relevant Jira issue?
### How should this be tested?
Build docs, go to elasticsearch one.
Author: Alexander Bezzubov <bz...@apache.org>
Closes #566 from bzz/fix/elasticsearch-docs and squashes the following commits:
638ab69 [Alexander Bezzubov] Elasticsearch: docs - keeping alphabetical order of interpreters
43ffcf9 [Alexander Bezzubov] Elasticsearch: docs - fix GFM markdown syntax
b7be462 [Alexander Bezzubov] Elasticsearch: docs - fix image size
243b0d1 [Alexander Bezzubov] Elasticsearch: docs - add interpreter to navigation menu
Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/d4396887
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/d4396887
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/d4396887
Branch: refs/heads/master
Commit: d4396887d032d2b6595afcd66b612739c26735f0
Parents: 7e90283
Author: Alexander Bezzubov <bz...@apache.org>
Authored: Tue Dec 22 20:51:19 2015 +0900
Committer: Alexander Bezzubov <bz...@apache.org>
Committed: Tue Dec 22 21:04:52 2015 +0900
----------------------------------------------------------------------
docs/_config.yml | 2 ++
docs/_includes/themes/zeppelin/_navigation.html | 1 +
docs/assets/themes/zeppelin/css/style.css | 6 +++-
docs/docs.md | 1 +
docs/interpreter/elasticsearch.md | 36 ++++++++++++--------
5 files changed, 31 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d4396887/docs/_config.yml
----------------------------------------------------------------------
diff --git a/docs/_config.yml b/docs/_config.yml
index bdba7a0..8a87551 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -5,6 +5,8 @@ permalink: /:categories/:year/:month/:day/:title
exclude: [".rvmrc", ".rbenv-version", "README.md", "Rakefile", "changelog.md", "vendor", "node_modules", "scss"]
pygments: true
markdown: redcarpet
+redcarpet:
+ extensions: ["tables"]
encoding: utf-8
# Themes are encouraged to use these universal variables
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d4396887/docs/_includes/themes/zeppelin/_navigation.html
----------------------------------------------------------------------
diff --git a/docs/_includes/themes/zeppelin/_navigation.html b/docs/_includes/themes/zeppelin/_navigation.html
index ef8a097..2c62282 100644
--- a/docs/_includes/themes/zeppelin/_navigation.html
+++ b/docs/_includes/themes/zeppelin/_navigation.html
@@ -37,6 +37,7 @@
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Interpreter <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{{BASE_PATH}}/interpreter/cassandra.html">Cassandra</a></li>
+ <li><a href="{{BASE_PATH}}/interpreter/elasticsearch.html">Elasticsearch</a></li>
<li><a href="{{BASE_PATH}}/interpreter/flink.html">Flink</a></li>
<li><a href="{{BASE_PATH}}/interpreter/geode.html">Geode</a></li>
<li><a href="{{BASE_PATH}}/interpreter/hive.html">Hive</a></li>
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d4396887/docs/assets/themes/zeppelin/css/style.css
----------------------------------------------------------------------
diff --git a/docs/assets/themes/zeppelin/css/style.css b/docs/assets/themes/zeppelin/css/style.css
index 066dd84..091d0bb 100644
--- a/docs/assets/themes/zeppelin/css/style.css
+++ b/docs/assets/themes/zeppelin/css/style.css
@@ -514,5 +514,9 @@ and (max-width: 1024px) {
}
#menu .navbar-brand {
- margin-right: 50px;
+ margin-right: 50px;
+}
+
+.row img {
+ max-width: 100%;
}
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d4396887/docs/docs.md
----------------------------------------------------------------------
diff --git a/docs/docs.md b/docs/docs.md
index 97cba96..a2347a8 100644
--- a/docs/docs.md
+++ b/docs/docs.md
@@ -44,6 +44,7 @@ limitations under the License.
* [sh](./pleasecontribute.html)
* [spark](./interpreter/spark.html)
* [tajo](./pleasecontribute.html)
+* [elasticsearch](./interpreter/elasticsearch.html)
### Storage
* [S3 Storage](./storage/storage.html)
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d4396887/docs/interpreter/elasticsearch.md
----------------------------------------------------------------------
diff --git a/docs/interpreter/elasticsearch.md b/docs/interpreter/elasticsearch.md
index fb83799..4a641c5 100644
--- a/docs/interpreter/elasticsearch.md
+++ b/docs/interpreter/elasticsearch.md
@@ -103,6 +103,7 @@ Example:
#### search
With the `search` command, you can send a search query to Elasticsearch. There are two formats of query:
+
* You can provide a JSON-formatted query, that is exactly what you provide when you use the REST API of Elasticsearch.
* See [Elasticsearch search API reference document](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html) for more details about the content of the search queries.
* You can also provide the content of a `query_string`
@@ -124,29 +125,33 @@ If you want to modify the size of the result set, you can add a line that is set
Examples:
-* With a JSON query:
-```bash
+
+ * With a JSON query:
+
+ ```bash
| %elasticsearch
| search / { "query": { "match_all": {} } }
-
+|
| %elasticsearch
| search /logs { "query": { "query_string": { "query": "request.method:GET AND status:200" } } }
-```
+ ```
-* With query_string elements:
-```bash
+ * With query_string elements:
+
+ ```bash
| %elasticsearch
| search /logs request.method:GET AND status:200
-
+|
| %elasticsearch
| search /logs (404 AND (POST OR DELETE))
-```
+ ```
> **Important**: a document in Elasticsearch is a JSON document, so it is hierarchical, not flat as a row in a SQL table.
For the Elastic interpreter, the result of a search query is flattened.
Suppose we have a JSON document:
-```json
+
+```
{
"date": "2015-12-08T21:03:13.588Z",
"request": {
@@ -160,16 +165,17 @@ Suppose we have a JSON document:
The data will be flattened like this:
+
date | request.headers[0] | request.headers[1] | request.method | request.url | status
-----|--------------------|--------------------|----------------|-------------|-------
2015-12-08T21:03:13.588Z | Accept: \*.\* | Host: apache.org | GET | /zeppelin/4cd001cd-c517-4fa9-b8e5-a06b8f4056c4 | 403
Examples:
+
* With a table containing the results:
![Elasticsearch - Search - table](../assets/themes/zeppelin/img/docs-img/elasticsearch-search-table.png)
-
* You can also use a predefined diagram:
![Elasticsearch - Search - diagram](../assets/themes/zeppelin/img/docs-img/elasticsearch-search-pie.png)
@@ -189,6 +195,7 @@ With the `count` command, you can count documents available in some indices and
```
Examples:
+
* Without query:
![Elasticsearch - Count](../assets/themes/zeppelin/img/docs-img/elasticsearch-count.png)
@@ -198,10 +205,11 @@ Examples:
#### index
With the `index` command, you can insert/update a document in Elasticsearch.
+
```bash
| %elasticsearch
| index /index/type/id <JSON document>
-
+|
| %elasticsearch
| index /index/type <JSON document>
```
@@ -221,8 +229,8 @@ With the `delete` command, you can delete a document.
You can leverage [Zeppelin Dynamic Form]({{BASE_PATH}}/manual/dynamicform.html) inside your queries. You can use both the `text input` and `select form` parameterization features
```bash
-%elasticsearch
-size ${limit=10}
-search /index/type { "query": { "match_all": {} } }
+| %elasticsearch
+| size ${limit=10}
+| search /index/type { "query": { "match_all": {} } }
```