Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery
/
devops
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
53ba5040
authored
Jan 21, 2019
by
Amir Aharon
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add reindexing
parent
fa94d16c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletions
common/docs/elasticsearch-rest.txt
common/docs/elasticsearch-rest.txt
View file @
53ba5040
#create index with mapping
curl -XPUT "http://localhost:9200/activityidx" -d'{ "mappings": { "activity": { "properties": { "metaData.loc": { "type": "geo_point" } } } } }'
- https://www.elastic.co/blog/changing-mapping-with-zero-downtime
Steps to change mapping type by reindexing and alias on a new index (using the kibana tools):
1 - get the mapping of the original index: GET activityidx/_mapping
2 - create a json file with the changed mapping
3 - curl -XPUT localhost:9200/activityidx_v1 -H 'Content-Type: application/json' -d @index-mapping (using curl)
4 reindex to the new original to the new one:
POST _reindex
{
"conflicts": "proceed",
"source": {
"index": "activityidx"
},
"dest": {
"index": "activityidx_v1"
}
}
5 - delete the original: DELETE activityidx
6 - make an alias of activityidx to the new one:
POST _aliases
{
"actions": [
{ "add": {
"alias": "activityidx",
"index": "activityidx_v1"
}}
]
}
# delete kibana settings
curl -XDELETE http://localhost:9200/.kibana
...
...
@@ -18,7 +46,7 @@ curl -XPOST 'http://172.16.1.72:9200/activityidx/activity/_search' -d '{
}'
# delete by query
curl -XPOST 'http://172.16.1.72:9200/activityidx/activity/_delete_by_query' -d '{
curl -XPOST 'http://172.16.1.72:9200/activityidx/activity/_delete_by_query
?conflicts=proceed
' -d '{
"query": {
"range": {
"published": {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment