def _perform_geocomplete_index_population(self, max_doc):
elasticsearch_conn = connections.get_connection()
to_index = list()
for i, document in enumerate(self._geocompletion_documents()):
if i % max_doc == 0:
log_msg = 'Computing required geoloc-entry documents.'
self._logging(logging.INFO, log_msg)
to_index.append(document.to_dict(True))
if len(to_index) < max_doc:
continue
self._geocomplete_index_batch(elasticsearch_conn, to_index)
to_index = list()
if len(to_index) != 0:
self._geocomplete_index_batch(elasticsearch_conn, to_index)
elasticsearch_dsl.Index('geocomplete').refresh()
评论列表
文章目录