<commit_before>/*
*
* Copyright (C) 2011, The Locker Project
* All rights reserved.
*
* Please see the LICENSE file for more information.
*
*/
var logger = require(__dirname + "/../../Common/node/logger").logger;
var fs = require('fs');
var lutil = require('lutil');
var lmongoutil = require("lmongoutil");

// in the future we'll probably need a visitCollection too
var linkCollection, encounterCollection, queueCollection;

exports.init = function(lCollection, eCollection, qCollection) {
    linkCollection = lCollection;
    linkCollection.ensureIndex({"link":1},{unique:true},function() {});
    encounterCollection = eCollection;
    queueCollection = qCollection;
}

exports.clear = function(callback) {
    linkCollection.drop(function() {
        encounterCollection.drop(function() {
            queueCollection.drop(callback);
        });
    });
}<commit_msg>adding indexes for busy collection fields<commit_after>/*
*
* Copyright (C) 2011, The Locker Project
* All rights reserved.
*
* Please see the LICENSE file for more information.
*
*/
var logger = require(__dirname + "/../../Common/node/logger").logger;
var fs = require('fs');
var lutil = require('lutil');
var lmongoutil = require("lmongoutil");

// in the future we'll probably need a visitCollection too
var linkCollection, encounterCollection, queueCollection;

exports.init = function(lCollection, eCollection, qCollection) {
    linkCollection = lCollection;
    linkCollection.ensureIndex({"link":1},{unique:true},function() {});
    encounterCollection = eCollection;
    encounterCollection.ensureIndex({"link":1},{background:true},function() {});
    encounterCollection.ensureIndex({"orig":1},{background:true},function() {});
    encounterCollection.ensureIndex({"_hash":1},{background:true},function() {});
    queueCollection = qCollection;
}

exports.clear = function(callback) {
    linkCollection.drop(function() {
        encounterCollection.drop(function() {
            queueCollection.drop(callback);
        });
    });
}
{'fraction_non_alphanumeric': 0.14299900695134063, 'fraction_numerical': 0.006454816285998014, 'mean_word_length': 4.708215297450425, 'pattern_counts': {'":': 5, '<': 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': '494956', 'n_tokens_mistral': 549, 'n_tokens_neox': 542, 'n_words': 128}