@@ -53,55 +53,6 @@ Perform the backup with the Backup gem's command line utility:
53
53
See more information in the [ ` Backup::Database::Elasticsearch ` ] ( lib/elasticsearch/extensions/backup.rb )
54
54
class documentation.
55
55
56
- ### Reindex
57
-
58
- Copy documents from one index and cluster into another one, for example for purposes of changing
59
- the settings and mappings of the index.
60
-
61
- ** NOTE:** Elasticsearch natively supports re-indexing since version 2.3. This extension is useful
62
- when you need the feature on older versions.
63
-
64
- When the extension is loaded together with the
65
- [ Ruby client for Elasticsearch] ( ../elasticsearch/README.md ) ,
66
- a ` reindex ` method is added to the client:
67
-
68
- require 'elasticsearch'
69
- require 'elasticsearch/extensions/reindex'
70
-
71
- client = Elasticsearch::Client.new
72
- target_client = Elasticsearch::Client.new url: 'http://localhost:9250', log: true
73
-
74
- client.index index: 'test', type: 'd', body: { title: 'foo' }
75
-
76
- client.reindex source: { index: 'test' },
77
- target: { index: 'test', client: target_client },
78
- transform: lambda { |doc| doc['_source']['title'].upcase! },
79
- refresh: true
80
- # => { errors: 0 }
81
-
82
- target_client.search index: 'test'
83
- # => ... hits ... "title"=>"FOO"
84
-
85
- The method takes similar arguments as the core API
86
- [ ` reindex ` ] ( http://www.rubydoc.info/gems/elasticsearch-api/Elasticsearch/API/Actions#reindex-instance_method )
87
- method.
88
-
89
- You can also use the ` Reindex ` class directly:
90
-
91
- require 'elasticsearch'
92
- require 'elasticsearch/extensions/reindex'
93
-
94
- client = Elasticsearch::Client.new
95
-
96
- reindex = Elasticsearch::Extensions::Reindex.new \
97
- source: { index: 'test', client: client },
98
- target: { index: 'test-copy' }
99
-
100
- reindex.perform
101
-
102
- See more information in the [ ` Elasticsearch::Extensions::Reindex::Reindex ` ] ( lib/elasticsearch/extensions/reindex.rb )
103
- class documentation.
104
-
105
56
### ANSI
106
57
107
58
Colorize and format selected Elasticsearch response parts in terminal:
0 commit comments