<commit_before>#!/bin/bash

if [ -z $1 ]; then
  mongos_port=27017
else
  mongos_port=$1
fi
if [ -z $2 ]; then
  num_shards=2
else
  num_shards=$2
fi


sh $SLI_HOME/config/scripts/sharding/kill-shard.sh
echo Shards killed.

sh $SLI_HOME/config/scripts/sharding/start-shard.sh $mongos_port $num_shards
echo Shards started.

mongo admin $SLI_HOME/config/shards/sli_shards.js
#mongo admin $SLI_HOME/config/shards/is_shards.js
echo shards configured.

mongo sli $SLI_HOME/config/indexes/sli_indexes.js
echo sli indexed.

mongo is $SLI_HOME/config/indexes/is_indexes.js
echo is indexed.

mongo ingestion_batch_job $SLI_HOME/config/indexes/ingestion_batch_job_indexes.js
echo ingestion_batch_job indexed.
<commit_msg>fix recycle-shards scripts to accomodate for changes to sli_shards.js<commit_after>#!/bin/bash

if [ -z $1 ]; then
  mongos_port=27017
else
  mongos_port=$1
fi
if [ -z $2 ]; then
  num_shards=2
else
  num_shards=$2
fi


sh $SLI_HOME/config/scripts/sharding/kill-shard.sh
echo Shards killed.

sh $SLI_HOME/config/scripts/sharding/start-shard.sh $mongos_port $num_shards
echo Shards started.

mongo admin $SLI_HOME/config/shards/sli_shards.js --eval "var database = 'sli'"
#mongo admin $SLI_HOME/config/shards/is_shards.js
echo shards configured.

mongo sli $SLI_HOME/config/indexes/sli_indexes.js
echo sli indexed.

mongo is $SLI_HOME/config/indexes/is_indexes.js
echo is indexed.

mongo ingestion_batch_job $SLI_HOME/config/indexes/ingestion_batch_job_indexes.js
echo ingestion_batch_job indexed.

{'fraction_non_alphanumeric': 0.10013262599469495, 'fraction_numerical': 0.013262599469496022, 'mean_word_length': 4.940944881889764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1451156', 'n_tokens_mistral': 635, 'n_tokens_neox': 601, 'n_words': 124}