Skip to content

Commit

Permalink
Merge pull request #6 from jthi3rry/percolators
Browse files Browse the repository at this point in the history
Reindex percolators after migrating data
  • Loading branch information
Thierry Jossermoz committed Jan 21, 2016
2 parents 0694e55 + 60a1cff commit ee9da33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ All contributions and comments are welcome. Simply create a pull request or repo
Changelog
=========

v0.0.5
------
* Reindex percolators after migrating data

v0.0.4
------
* Allow passing create and copy kwargs to migrate
Expand Down
2 changes: 1 addition & 1 deletion slingshot/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.4'
__version__ = '0.0.5'
5 changes: 3 additions & 2 deletions slingshot/indices_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ def _process_hits(hits, index):
continue
yield doc

# Make sure percolators are copied across too
helpers.reindex(self.client, source_index=source_index, target_index=target_index, scan_kwargs={"doc_type": ".percolator"})
if parallel:
for _ in helpers.parallel_bulk(self.client, _process_hits(hits, target_index), **bulk_kwargs):
pass
else:
helpers.bulk(self.client, _process_hits(hits, target_index), stats_only=True, **bulk_kwargs)

# Make sure percolators are copied across too
helpers.reindex(self.client, source_index=source_index, target_index=target_index, scan_kwargs={"doc_type": ".percolator"})

def _generate_name(self, name):
return ".".join([name, str(int(time.time() * 1000))])

Expand Down

0 comments on commit ee9da33

Please sign in to comment.