Skip to content

Commit 773ac12

Browse files
committed
make shards configurable
1 parent b5221b0 commit 773ac12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index_emails.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create_index():
3030

3131
schema = {
3232
"settings": {
33-
"number_of_shards": 2,
33+
"number_of_shards": tornado.options.options.num_of_shards,
3434
"number_of_replicas": 0
3535
},
3636
"mappings": {
@@ -173,6 +173,9 @@ def load_from_file():
173173
tornado.options.define("skip", type=int, default=0,
174174
help="Number of messages to skip from the mbox file")
175175

176+
tornado.options.define("num_of_shards", type=int, default=2,
177+
help="Number of shards for ES index")
178+
176179
tornado.options.parse_command_line()
177180

178181
if tornado.options.options.infile:

0 commit comments

Comments
 (0)