Changes
Page history
jbleonesio created page: Elasticsearch
authored
Jun 09, 2015
by
Jean-Baptiste Leonesio
Show whitespace changes
Inline
Side-by-side
Elasticsearch.markdown
View page @
775f68de
...
@@ -137,6 +137,31 @@ Any visualisation can be filtered using a request:
...
@@ -137,6 +137,31 @@ Any visualisation can be filtered using a request:


# Export
```
bash
#!/bin/bash
test
$#
-ne
2
&&
echo
"usage:
`
basename
$0
`
index output_file"
&&
exit
1
index
=
"
$1
"
output
=
"
$2
"
# Get scroll token
scroll_id
=
`
curl
--silent
-XGET
"http://localhost:9200/
$index
/_search?scroll=1m&search_type=scan"
-d
'
{
"query": { "match_all": {}},
"size": 10000
}'
| jq
-r
'._scroll_id'
`
# Iterate through the whole index
while
[[
$scroll_id
!=
null
]]
;
do
ret
=
`
curl
--silent
-XGET
'http://localhost:9200/_search/scroll?scroll=1m'
-d
$scroll_id
`
echo
"
$ret
"
| jq
-r
'.hits.hits[]._source | del(.message) | to_entries | map([.value]) | [.[] | .[] | tostring] | @csv'
>>
"
$output
"
scroll_id
=
`
echo
$ret
| jq
-r
'._scroll_id'
`
done
```
# Shards
# Shards
Shards are
[
Lucene
](
https://lucene.apache.org/core/
)
databases.
Shards are
[
Lucene
](
https://lucene.apache.org/core/
)
databases.
...
...
...
...