2 """ Contains code for indexing other objects """
5 from pyes
.exceptions
import IndexAlreadyExistsException
7 from django
.conf
import settings
10 logger
= logging
.getLogger(__name__
)
13 def index_podcast(sender
, **kwargs
):
18 """ Creates the Elasticsearch index """
19 conn
= ES(settings
.ELASTICSEARCH_SERVER
)
21 logger
.info('Creating index %s' % settings
.ELASTICSEARCH_INDEX
)
23 conn
.indices
.create_index(settings
.ELASTICSEARCH_INDEX
)
25 except IndexAlreadyExistsException
as ex
: