original_docstring: Update mapping and settings for current Elasticsearch index.
docstring: Update mapping and settings for current Elasticsearch index.
docstring_tokens: Update mapping and settings for current Elasticsearch index .
code: def update_mapping():
      """Update mapping and settings for current Elasticsearch index."""
  
      es_index = collections.current().es_index
      url = f'{ES_URL}/{es_index}/_mapping/{DOCUMENT_TYPE}'
      log.info("PUT %s", url)
      put_resp = put_json(url, MAPPINGS[DOCUMENT_TYPE])
      check_response(put_resp)
  
      index_settings = {
          "index": {
              "refresh_interval": collections.current().refresh_interval,
              "max_result_window": collections.current().max_result_window,
              "number_of_replicas": 0,
          }
      }
      url = f'{ES_URL}/{es_index}/_settings'
      log.info("PUT %s", url)
      put_resp = put_json(url, index_settings)
      check_response(put_resp)
code_tokens: def update_mapping ( ) : es_index = collections . current ( ) . es_index url = f'{ES_URL}/{es_index}/_mapping/{DOCUMENT_TYPE}' log . info ( "PUT %s" , url ) put_resp = put_json ( url , MAPPINGS [ DOCUMENT_TYPE ] ) check_response ( put_resp ) index_settings = { "index" : { "refresh_interval" : collections . current ( ) . refresh_interval , "max_result_window" : collections . current ( ) . max_result_window , "number_of_replicas" : 0 , } } url = f'{ES_URL}/{es_index}/_settings' log . info ( "PUT %s" , url ) put_resp = put_json ( url , index_settings ) check_response ( put_resp )
short_docstring: Update mapping and settings for current Elasticsearch index.
short_docstring_tokens: Update mapping and settings for current Elasticsearch index .
comment: """Update mapping and settings for current Elasticsearch index."""