"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.23/rest-api-spec/src/main/resources/rest-api-spec/test/indices.validate_query/10_basic.yml" (29 Dec 2021, 1431 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 setup:
    2   - do:
    3       indices.create:
    4         index: testing
    5         body:
    6           settings:
    7             number_of_replicas: 0
    8           aliases:
    9             alias_1:
   10               "filter" : { "match_all" : {} }
   11 
   12 
   13 ---
   14 "Validate query api":
   15   - do:
   16       indices.validate_query:
   17         q: query string
   18         index: testing
   19 
   20   - is_true: valid
   21 
   22   - do:
   23       indices.validate_query:
   24         q: query string
   25         index: alias_1
   26 
   27   - is_true: valid
   28 
   29   - do:
   30       indices.validate_query:
   31         body:
   32           query:
   33             invalid_query: {}
   34 
   35   - is_false: valid
   36   - is_false: error
   37 
   38   - do:
   39       indices.validate_query:
   40         explain: true
   41         body:
   42           query:
   43             invalid_query: {}
   44 
   45   - is_false: valid
   46   - match: {error: 'org.elasticsearch.common.ParsingException: no [query] registered for [invalid_query]'}
   47 
   48   - do:
   49       indices.validate_query:
   50         explain: true
   51 
   52   - is_true: valid
   53   - match: {_shards.failed: 0}
   54   - match: {explanations.0.index: 'testing'}
   55   - match: {explanations.0.explanation: '*:*'}
   56 
   57 ---
   58 "Validate body without query element":
   59   - do:
   60       indices.validate_query:
   61         body:
   62           match_all: {}
   63 
   64   - is_false: valid
   65   - is_false: error
   66 
   67   - do:
   68       indices.validate_query:
   69         explain: true
   70         body:
   71           match_all: {}
   72 
   73   - is_false: valid
   74   - match: {error: 'org.elasticsearch.common.ParsingException: request does not support [match_all]'}