<commit_before>define [
    '../core'
    '../search'
], (c, search)->

    # Takes a collection of concepts to filter/get the concept model instances
    # for rendering
    class ConceptSearch extends search.Search
        className: 'concept-search search'

        events:
            'input typeahead:selected': 'focusConcept'

        options: ->
            url = c.data.concepts.url()

            return {
                name: 'Concepts'
                valueKey: 'name'
                limit: 10
                remote:
                    url: "#{ url }?query=%QUERY&brief=1"
                    filter: (resp) =>
                        datums = []
                        c._.each resp, (datum) =>
                            if @collection.get(datum.id)
                                datums.push(datum)<commit_msg>Fix reversed events hash for ConceptSearch, add autocomplete handler<commit_after>define [
    '../core'
    '../search'
], (c, search)->

    # Takes a collection of concepts to filter/get the concept model instances
    # for rendering
    class ConceptSearch extends search.Search
        className: 'concept-search search'

        events:
            'typeahead:selected input': 'focusConcept'
            'typeahead:autocompleted input': 'focusConcept'

        options: ->
            url = c.data.concepts.url()

            return {
                name: 'Concepts'
                valueKey: 'name'
                limit: 10
                remote:
                    url: "#{ url }?query=%QUERY&brief=1"
                    filter: (resp) =>
                        datums = []
                        c._.each resp, (datum) =>
                            if @collection.get(datum.id)
                                datums.push(datum)
{'fraction_non_alphanumeric': 0.10298255486775464, 'fraction_numerical': 0.0033764772087788407, 'mean_word_length': 1.2794871794871794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7045645', 'n_tokens_mistral': 478, 'n_tokens_neox': 438, 'n_words': 114}