"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.23/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml" (29 Dec 2021, 1802 Bytes) of package /linux/www/elasticsearch-6.8.23-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ---
    2 "Array of objects":
    3   - do:
    4       bulk:
    5         refresh: true
    6         body:
    7           - index:
    8               _index: test_index
    9               _type:  test_type
   10               _id:    test_id
   11           - f1: v1
   12             f2: 42
   13           - index:
   14               _index: test_index
   15               _type:  test_type
   16               _id:    test_id2
   17           - f1: v2
   18             f2: 47
   19 
   20   - do:
   21       count:
   22         index: test_index
   23 
   24   - match: {count: 2}
   25 
   26 ---
   27 "Empty _id":
   28   - skip:
   29       version: " - 5.3.0"
   30       reason: empty IDs were not rejected until 5.3.1
   31   - do:
   32       bulk:
   33         refresh: true
   34         body:
   35           - index:
   36               _index: test
   37               _type: type
   38               _id: ''
   39           - f: 1
   40           - index:
   41               _index: test
   42               _type: type
   43               _id: id
   44           - f: 2
   45           - index:
   46               _index: test
   47               _type: type
   48           - f: 3
   49   - match: { errors: true }
   50   - match: { items.0.index.status: 400 }
   51   - match: { items.0.index.error.type: illegal_argument_exception }
   52   - match: { items.0.index.error.reason: if _id is specified it must not be empty }
   53   - match: { items.1.index.result: created }
   54   - match: { items.2.index.result: created }
   55 
   56   - do:
   57       count:
   58         index: test
   59 
   60   - match: { count: 2 }
   61 
   62 ---
   63 "empty action":
   64 
   65   - skip:
   66       version: " - 5.4.99"
   67       reason: confusing exception messaged caused by empty object fixed in 5.5.0
   68       features: ["headers"]
   69 
   70   - do:
   71       catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/
   72       headers:
   73         Content-Type: application/json
   74       bulk:
   75         body: |
   76            {"index": {"_index": "test_index", "_type": "test_type", "_id": "test_id"}}
   77            {"f1": "v1", "f2": 42}
   78            {}