<commit_before>*****************************************************
Install and configure the ElasticSearch search server
*****************************************************

Install ElasticSearch
=====================
See http://www.elasticsearch.org/.


Configure ElasticSearch as the Devilry search backend
=====================================================
Add the following to ``~/devilrydeploy/devilry_settings.py``::

    HAYSTACK_CONNECTIONS = {
        'default': {
            'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
            'URL': 'http://127.0.0.1:9200/',
            'INDEX_NAME': 'devilry',
        },
    }

Adjust the URL if you are running ElasticSearch on a separate server or another port.<commit_msg>docs.sysadmin: Added rebuild_index for elasticsearch.<commit_after>*****************************************************
Install and configure the ElasticSearch search server
*****************************************************

Install ElasticSearch
=====================
See http://www.elasticsearch.org/.


Configure ElasticSearch as the Devilry search backend
=====================================================
Add the following to ``~/devilrydeploy/devilry_settings.py``::

    HAYSTACK_CONNECTIONS = {
        'default': {
            'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
            'URL': 'http://127.0.0.1:9200/',
            'INDEX_NAME': 'devilry',
        },
    }

Adjust the URL if you are running ElasticSearch on a separate server or another port.


Build the search index
======================
To index the data currently in the database, run::

    $ cd ~/devilrydeploy/
    $ python manage.py rebuild_index --noinput
{'fraction_non_alphanumeric': 0.29354654483152487, 'fraction_numerical': 0.011422044545973729, 'mean_word_length': 4.457943925233645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '4618333', 'n_tokens_mistral': 459, 'n_tokens_neox': 416, 'n_words': 116}