<commit_before>require('cloud/app.js');
var Fuse = require('cloud/fuse.min.js');

/*
 * Provides Cloud Functions for Rice Maps.
 */
Parse.Cloud.define("placesSearch", function(request, response) {
  console.log("Search Query: " + request.params.query);

  // Define Parse cloud query that retrieves all Place objects and matches them to a search
  var query = new Parse.Query("Place");
  query.find({
    success: function(results) {
      // Perform Fuse.js fuzzy search on all Place objects
      var options = {
        keys: ['name', 'symbol']
      }
      searcher = new Fuse(results, options);
      matches = searcher.search(request.params.query)

      response.success(matches);
    },
    error: function(error) {
      response.error(error);
    }<commit_msg>remove results.length log from main.js<commit_after>require('cloud/app.js');
var Fuse = require('cloud/fuse.min.js');

/*
 * Provides Cloud Functions for Rice Maps.
 */
Parse.Cloud.define("placesSearch", function(request, response) {
  console.log("Search Query: " + request.params.query);

  // Define Parse cloud query that retrieves all Place objects and matches them to a search
  var query = new Parse.Query("Place");
  query.find({
    success: function(results) {
      // Converts Parse objects to json so Fuse can use them
      var places = results.map(function(obj){
        return obj.toJSON();
      });
      // Perform Fuse.js fuzzy search on all Place objects
      var options = {
        keys: ['name', 'symbol']
      }

      var searcher = new Fuse(places, options);
      var matches = searcher.search(request.params.query);
      response.success(matches);
    },
    error: function(error) {
      response.error(error);
    }
{'fraction_non_alphanumeric': 0.12783265543288785, 'fraction_numerical': 0.0, 'mean_word_length': 3.0709219858156027, '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': '1414699', 'n_tokens_mistral': 505, 'n_tokens_neox': 492, 'n_words': 143}