-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
batch index to have single batch mode for source/collections of an or…
…g/user
- Loading branch information
1 parent
3c5d1af
commit e61d65d
Showing
2 changed files
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -177,10 +177,13 @@ def get_exact_or_criteria(attr, values): | |||
return criteria | ||||
|
||||
@staticmethod | ||||
def batch_index(queryset, document): | ||||
def batch_index(queryset, document, single_batch=False): | ||||
if not get(settings, 'TEST_MODE'): | ||||
for batch in queryset.iterator(chunk_size=500): | ||||
document().update(batch, parallel=True) | ||||
if single_batch: | ||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
snyaggarwal
Author
Contributor
|
instance.batch_index(instance.source_set, SourceDocument, True) |
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@snyaggarwal Could you please explain what's the single_batch for? Maybe add a method doc.