<commit_before>var search = require('../lib/search');

//***************************************************************************************************************************
// allUsersInformation
exports.getSuggestions = function (request) {

    var value = request.params.value;
    var key = request.params.key;
      var arr = ['dwa', 'dwad'];
   // search.cacheData('myKey', ['mahmut', 'sevki']);

    //search.getTheValue(key, value, function(err, arr){

        request.reply (JSON.stringify(arr));

    //});





};




<commit_msg>example usage for autocomplete<commit_after>var search = require('../lib/search');

//var cache = require('../lib/cache');

//***************************************************************************************************************************
// allUsersInformation
exports.getSuggestions = function (request) {

    var value = request.params.value;
    var key = request.params.key;
    //var arr = ['dwa', 'dwad'];

    var myArray = ['burhan', 'mahmut'];

    search.cacheData(key, myArray,function(error){
        if(error){
            console.log('error occured');

            search.getTheValue(key, value,function(err, result){

                if(err){
                    console.log(err);
                    request.reply(err);

                }else{
                    console.log(result);
                    request.reply(result);
                }

            });


        };


    });

              /*
    //check if key is exist
    cache.getZrange(key, value,  function(err,obj){

        if(err){request.reply(err);return false;}

        //if cache is not empty
        if(obj){
            //if key exist return the mapped values
            cache.hashMultipleGet(key, obj, function(err2, obj2){
                if(err2){request.reply(err2); return false;}
                console.log(obj2);
                request.reply(JSON.stringify(obj2));
                return true;
            });
        }else{


               //else we need to cache it
              search.cacheData(key, myArray);
            request.reply(JSON.stringify(myArray));

        }
    });

            */


};





{'fraction_non_alphanumeric': 0.24126838235294118, 'fraction_numerical': 0.0027573529411764708, 'mean_word_length': 2.061884669479606, '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': '2190651', 'n_tokens_mistral': 600, 'n_tokens_neox': 540, 'n_words': 111}