<commit_before>'use strict';

var BusinessSearchEvents = require('../../constants/BusinessSearchConstants').Events;

module.exports = function (context, payload, done) {
    var params = payload.query;

    context.dispatch(BusinessSearchEvents.SEARCH, {
        queryParams: params
    });

    context
        .getHairfieApi()
        .search(params.query, params.isGeoipable)
        .then(function (businesses) {
            context.dispatch(BusinessSearchEvents.SEARCH_SUCCESS, {
                businesses: businesses,
                queryParams: params
            });
            done();
        })
        .fail(function (error) {
            context.dispatch(BusinessSearchEvents.SEARCH_FAILURE);
            done(error);
        });
    done();
};<commit_msg>fix first loading<commit_after>'use strict';

var BusinessSearchEvents = require('../../constants/BusinessSearchConstants').Events;

module.exports = function (context, payload, done) {
    var params = payload.query;

    context.dispatch(BusinessSearchEvents.SEARCH, {
        queryParams: params
    });

    context
        .getHairfieApi()
        .search(params.query, params.isGeoipable)
        .then(function (businesses) {
            context.dispatch(BusinessSearchEvents.SEARCH_SUCCESS, {
                businesses: businesses,
                queryParams: params
            });
            done();
        })
        .fail(function (error) {
            context.dispatch(BusinessSearchEvents.SEARCH_FAILURE);
            done(error);
        });
    //done();
};
{'fraction_non_alphanumeric': 0.11757105943152454, 'fraction_numerical': 0.0, 'mean_word_length': 2.20703933747412, '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': '1193406', 'n_tokens_mistral': 410, 'n_tokens_neox': 399, 'n_words': 68}