---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
refresh=true immediately makes changes are visible in search:
- do:
    bulk:
      refresh: true
      body: "{\"index\": {\"_index\": \"bulk_50_refresh_1\", \"_id\": \"bulk_50_refresh_id1\"\
        }}\n{\"f1\": \"v1\", \"f2\": 42}\n{\"index\": {\"_index\": \"bulk_50_refresh_1\"\
        , \"_id\": \"bulk_50_refresh_id2\"}}\n{\"f1\": \"v2\", \"f2\": 47}\n"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    count:
      index: "bulk_50_refresh_1"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    count: 2
---
refresh=empty string immediately makes changes are visible in search:
- do:
    bulk:
      refresh: ""
      body: "{\"index\": {\"_index\": \"bulk_50_refresh_2\", \"_id\": \"bulk_50_refresh_id3\"\
        }}\n{\"f1\": \"v1\", \"f2\": 42}\n{\"index\": {\"_index\": \"bulk_50_refresh_2\"\
        , \"_id\": \"bulk_50_refresh_id4\"}}\n{\"f1\": \"v2\", \"f2\": 47}\n"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    count:
      index: "bulk_50_refresh_2"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    count: 2
---
refresh=wait_for waits until changes are visible in search:
- do:
    bulk:
      refresh: "wait_for"
      body: "{\"index\": {\"_index\": \"bulk_50_refresh_3\", \"_id\": \"bulk_50_refresh_id5\"\
        }}\n{\"f1\": \"v1\", \"f2\": 42}\n{\"index\": {\"_index\": \"bulk_50_refresh_3\"\
        , \"_id\": \"bulk_50_refresh_id6\"}}\n{\"f1\": \"v2\", \"f2\": 47}\n"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    count:
      index: "bulk_50_refresh_3"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    count: 2
