From fa69848f4f7e86fac6e3963bdc7a90673580ea2b Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Fri, 21 Sep 2018 17:18:38 +0200 Subject: [PATCH] Start moving docs to typeless APIs. A number of APIs (index creation, put mapping, index, etc.) will soon trigger deprecation warnings unless users opt in for typeless APIs by passing `include_type_name=false`. Relates #15613 --- docs/build.gradle | 394 +++++++++--------- .../adjacency-matrix-aggregation.asciidoc | 4 +- .../autodatehistogram-aggregation.asciidoc | 16 +- .../bucket/children-aggregation.asciidoc | 22 +- .../bucket/composite-aggregation.asciidoc | 56 ++- .../bucket/datehistogram-aggregation.asciidoc | 26 +- .../bucket/daterange-aggregation.asciidoc | 10 +- .../diversified-sampler-aggregation.asciidoc | 4 +- .../bucket/filter-aggregation.asciidoc | 2 +- .../bucket/filters-aggregation.asciidoc | 10 +- .../bucket/geodistance-aggregation.asciidoc | 22 +- .../bucket/geohashgrid-aggregation.asciidoc | 16 +- .../bucket/global-aggregation.asciidoc | 2 +- .../bucket/histogram-aggregation.asciidoc | 10 +- .../bucket/iprange-aggregation.asciidoc | 8 +- .../bucket/missing-aggregation.asciidoc | 4 +- .../bucket/nested-aggregation.asciidoc | 22 +- .../bucket/range-aggregation.asciidoc | 18 +- .../reverse-nested-aggregation.asciidoc | 2 +- .../bucket/sampler-aggregation.asciidoc | 6 +- .../significantterms-aggregation.asciidoc | 30 +- .../significanttext-aggregation.asciidoc | 10 +- .../bucket/terms-aggregation.asciidoc | 58 ++- .../matrix/stats-aggregation.asciidoc | 4 +- .../metrics/avg-aggregation.asciidoc | 10 +- .../metrics/cardinality-aggregation.asciidoc | 10 +- .../extendedstats-aggregation.asciidoc | 12 +- .../metrics/geobounds-aggregation.asciidoc | 14 +- .../metrics/geocentroid-aggregation.asciidoc | 16 +- .../metrics/max-aggregation.asciidoc | 10 +- .../metrics/min-aggregation.asciidoc | 10 +- .../metrics/percentile-aggregation.asciidoc | 16 +- .../percentile-rank-aggregation.asciidoc | 12 +- .../scripted-metric-aggregation.asciidoc | 6 +- .../metrics/stats-aggregation.asciidoc | 10 +- .../metrics/sum-aggregation.asciidoc | 10 +- .../metrics/tophits-aggregation.asciidoc | 33 +- .../metrics/valuecount-aggregation.asciidoc | 6 +- .../metrics/weighted-avg-aggregation.asciidoc | 8 +- docs/reference/aggregations/misc.asciidoc | 7 +- docs/reference/aggregations/pipeline.asciidoc | 8 +- .../pipeline/avg-bucket-aggregation.asciidoc | 2 +- .../bucket-script-aggregation.asciidoc | 2 +- .../bucket-selector-aggregation.asciidoc | 2 +- .../pipeline/bucket-sort-aggregation.asciidoc | 4 +- .../cumulative-sum-aggregation.asciidoc | 2 +- .../pipeline/derivative-aggregation.asciidoc | 6 +- ...extended-stats-bucket-aggregation.asciidoc | 2 +- .../pipeline/max-bucket-aggregation.asciidoc | 2 +- .../pipeline/min-bucket-aggregation.asciidoc | 2 +- .../pipeline/movavg-aggregation.asciidoc | 18 +- .../pipeline/movfn-aggregation.asciidoc | 22 +- .../percentiles-bucket-aggregation.asciidoc | 2 +- .../pipeline/serial-diff-aggregation.asciidoc | 2 +- .../stats-bucket-aggregation.asciidoc | 2 +- .../pipeline/sum-bucket-aggregation.asciidoc | 2 +- .../pattern-replace-charfilter.asciidoc | 17 +- .../tokenizers/edgengram-tokenizer.asciidoc | 19 +- docs/reference/api-conventions.asciidoc | 22 +- docs/reference/cat/fielddata.asciidoc | 24 +- docs/reference/docs/bulk.asciidoc | 38 +- docs/reference/docs/delete-by-query.asciidoc | 4 +- docs/reference/docs/delete.asciidoc | 7 +- docs/reference/docs/get.asciidoc | 13 +- docs/reference/docs/index_.asciidoc | 14 +- docs/reference/docs/reindex.asciidoc | 4 +- docs/reference/docs/update-by-query.asciidoc | 8 +- docs/reference/docs/update.asciidoc | 27 +- docs/reference/getting-started.asciidoc | 80 ++-- .../how-to/recipes/stemming.asciidoc | 34 +- docs/reference/how-to/search-speed.asciidoc | 64 ++- .../index-modules/index-sorting.asciidoc | 4 +- .../index-modules/similarity.asciidoc | 42 +- docs/reference/indices/create-index.asciidoc | 18 +- .../reference/indices/rollover-index.asciidoc | 4 +- .../mapping/fields/id-field.asciidoc | 2 +- .../mapping/fields/ignored-field.asciidoc | 4 +- .../mapping/fields/index-field.asciidoc | 2 +- .../mapping/fields/routing-field.asciidoc | 12 +- .../mapping/fields/source-field.asciidoc | 2 +- .../mapping/fields/type-field.asciidoc | 2 +- .../mapping/params/analyzer.asciidoc | 2 +- docs/reference/mapping/params/boost.asciidoc | 4 +- .../reference/mapping/params/copy-to.asciidoc | 2 +- .../mapping/params/ignore-above.asciidoc | 18 +- .../mapping/params/index-options.asciidoc | 2 +- .../mapping/params/multi-fields.asciidoc | 4 +- .../mapping/params/normalizer.asciidoc | 26 +- .../mapping/params/null-value.asciidoc | 2 +- .../params/position-increment-gap.asciidoc | 6 +- .../mapping/params/properties.asciidoc | 2 +- .../mapping/params/search-analyzer.asciidoc | 2 +- docs/reference/mapping/params/store.asciidoc | 2 +- .../mapping/params/term-vector.asciidoc | 2 +- .../mapping/removal_of_types.asciidoc | 6 +- docs/reference/mapping/types/alias.asciidoc | 4 +- docs/reference/mapping/types/array.asciidoc | 2 +- docs/reference/mapping/types/boolean.asciidoc | 4 +- docs/reference/mapping/types/date.asciidoc | 2 +- .../mapping/types/feature-vector.asciidoc | 2 +- docs/reference/mapping/types/feature.asciidoc | 2 +- .../mapping/types/geo-point.asciidoc | 2 +- docs/reference/mapping/types/ip.asciidoc | 8 +- docs/reference/mapping/types/nested.asciidoc | 6 +- .../mapping/types/parent-join.asciidoc | 86 ++-- .../mapping/types/percolator.asciidoc | 139 +++--- docs/reference/mapping/types/range.asciidoc | 10 +- .../mapping/types/token-count.asciidoc | 2 +- .../modules/cross-cluster-search.asciidoc | 11 +- .../modules/indices/request_cache.asciidoc | 2 +- .../modules/scripting/engine.asciidoc | 2 +- .../modules/scripting/fields.asciidoc | 6 +- .../modules/scripting/using.asciidoc | 4 +- docs/reference/query-dsl/bool-query.asciidoc | 8 +- .../query-dsl/boosting-query.asciidoc | 2 +- .../query-dsl/common-terms-query.asciidoc | 18 +- .../query-dsl/constant-score-query.asciidoc | 2 +- .../query-dsl/dis-max-query.asciidoc | 2 +- .../reference/query-dsl/exists-query.asciidoc | 4 +- .../query-dsl/feature-query.asciidoc | 40 +- .../query-dsl/function-score-query.asciidoc | 16 +- docs/reference/query-dsl/fuzzy-query.asciidoc | 4 +- .../query-dsl/geo-bounding-box-query.asciidoc | 18 +- .../query-dsl/geo-distance-query.asciidoc | 10 +- .../query-dsl/geo-polygon-query.asciidoc | 8 +- .../query-dsl/geo-shape-query.asciidoc | 4 +- .../query-dsl/has-child-query.asciidoc | 8 +- .../query-dsl/has-parent-query.asciidoc | 6 +- docs/reference/query-dsl/ids-query.asciidoc | 2 +- .../query-dsl/match-all-query.asciidoc | 6 +- .../match-phrase-prefix-query.asciidoc | 4 +- .../query-dsl/match-phrase-query.asciidoc | 4 +- docs/reference/query-dsl/match-query.asciidoc | 10 +- docs/reference/query-dsl/mlt-query.asciidoc | 6 +- .../query-dsl/multi-match-query.asciidoc | 28 +- .../reference/query-dsl/nested-query.asciidoc | 2 +- .../query-dsl/parent-id-query.asciidoc | 2 +- .../query-dsl/percolate-query.asciidoc | 43 +- .../reference/query-dsl/prefix-query.asciidoc | 4 +- .../query-dsl/query-string-query.asciidoc | 18 +- .../query-dsl/query_filter_context.asciidoc | 2 +- docs/reference/query-dsl/range-query.asciidoc | 8 +- .../reference/query-dsl/regexp-query.asciidoc | 8 +- .../reference/query-dsl/script-query.asciidoc | 4 +- .../simple-query-string-query.asciidoc | 10 +- .../query-dsl/span-containing-query.asciidoc | 2 +- .../span-field-masking-query.asciidoc | 2 +- .../query-dsl/span-first-query.asciidoc | 2 +- .../query-dsl/span-multi-term-query.asciidoc | 4 +- .../query-dsl/span-near-query.asciidoc | 2 +- .../query-dsl/span-not-query.asciidoc | 2 +- .../query-dsl/span-or-query.asciidoc | 2 +- .../query-dsl/span-term-query.asciidoc | 6 +- .../query-dsl/span-within-query.asciidoc | 2 +- docs/reference/query-dsl/term-query.asciidoc | 12 +- docs/reference/query-dsl/terms-query.asciidoc | 4 +- .../query-dsl/terms-set-query.asciidoc | 5 +- docs/reference/query-dsl/type-query.asciidoc | 2 +- .../query-dsl/wildcard-query.asciidoc | 6 +- .../query-dsl/wrapper-query.asciidoc | 2 +- docs/reference/redirects.asciidoc | 4 +- .../rollup/apis/rollup-search.asciidoc | 4 +- .../rollup/rollup-getting-started.asciidoc | 4 +- .../rollup/rollup-search-limitations.asciidoc | 2 +- docs/reference/search.asciidoc | 6 +- docs/reference/search/profile.asciidoc | 6 +- docs/reference/search/request-body.asciidoc | 5 +- .../search/request/collapse.asciidoc | 8 +- .../search/request/docvalue-fields.asciidoc | 4 +- .../reference/search/request/explain.asciidoc | 2 +- .../search/request/from-size.asciidoc | 2 +- .../request/highlighters-internal.asciidoc | 2 +- .../search/request/highlighting.asciidoc | 40 +- .../search/request/index-boost.asciidoc | 4 +- .../search/request/inner-hits.asciidoc | 76 ++-- .../search/request/min-score.asciidoc | 2 +- .../named-queries-and-filters.asciidoc | 2 +- .../search/request/post-filter.asciidoc | 20 +- .../search/request/preference.asciidoc | 2 +- docs/reference/search/request/query.asciidoc | 2 +- .../reference/search/request/rescore.asciidoc | 4 +- .../search/request/script-fields.asciidoc | 4 +- docs/reference/search/request/scroll.asciidoc | 10 +- .../search/request/search-after.asciidoc | 4 +- docs/reference/search/request/sort.asciidoc | 28 +- .../search/request/source-filtering.asciidoc | 8 +- .../search/request/stored-fields.asciidoc | 6 +- .../reference/search/request/version.asciidoc | 2 +- .../reference/search/search-template.asciidoc | 8 +- docs/reference/search/search.asciidoc | 8 +- docs/reference/search/suggesters.asciidoc | 6 +- .../suggesters/completion-suggest.asciidoc | 34 +- .../suggesters/context-suggest.asciidoc | 88 ++-- .../reference/search/suggesters/misc.asciidoc | 2 +- .../search/suggesters/phrase-suggest.asciidoc | 6 +- docs/reference/search/uri-request.asciidoc | 3 +- 196 files changed, 1250 insertions(+), 1401 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index 864567ba8358a..7d10e70de99f7 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -108,25 +108,25 @@ Closure setupTwitter = { String name, int count -> buildRestTests.setups[name] = ''' - do: indices.create: + include_type_name: false index: twitter body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - _doc: - properties: - user: - type: keyword - doc_values: true - date: - type: date - likes: - type: long + properties: + user: + type: keyword + doc_values: true + date: + type: date + likes: + type: long - do: bulk: + include_type_name: false index: twitter - type: _doc refresh: true body: |''' for (int i = 0; i < count; i++) { @@ -172,22 +172,22 @@ buildRestTests.setups['node'] = ''' buildRestTests.setups['ledger'] = ''' - do: indices.create: + include_type_name: false index: ledger body: settings: number_of_shards: 2 number_of_replicas: 1 mappings: - _doc: - properties: - type: - type: keyword - amount: - type: double + properties: + type: + type: keyword + amount: + type: double - do: bulk: + include_type_name: false index: ledger - type: _doc refresh: true body: | {"index":{}} @@ -205,20 +205,20 @@ buildRestTests.setups['ledger'] = ''' buildRestTests.setups['sales'] = ''' - do: indices.create: + include_type_name: false index: sales body: settings: number_of_shards: 2 number_of_replicas: 1 mappings: - _doc: - properties: - type: - type: keyword + properties: + type: + type: keyword - do: bulk: + include_type_name: false index: sales - type: _doc refresh: true body: | {"index":{}} @@ -240,6 +240,7 @@ buildRestTests.setups['sales'] = ''' buildRestTests.setups['bank'] = ''' - do: indices.create: + include_type_name: false index: bank body: settings: @@ -247,8 +248,8 @@ buildRestTests.setups['bank'] = ''' number_of_routing_shards: 5 - do: bulk: + include_type_name: false index: bank - type: _doc refresh: true body: | #bank_data# @@ -270,6 +271,7 @@ buildRestTests.doFirst { buildRestTests.setups['index_boost'] = ''' - do: indices.create: + include_type_name: false index: index1 - do: indices.create: @@ -284,22 +286,22 @@ buildRestTests.setups['index_boost'] = ''' buildRestTests.setups['stackoverflow'] = ''' - do: indices.create: + include_type_name: false index: stackoverflow body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - _doc: - properties: - author: - type: keyword - tags: - type: keyword + properties: + author: + type: keyword + tags: + type: keyword - do: bulk: + include_type_name: false index: stackoverflow - type: _doc refresh: true body: |''' @@ -339,22 +341,22 @@ buildRestTests.setups['stackoverflow'] += """ buildRestTests.setups['news'] = ''' - do: indices.create: + include_type_name: false index: news body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - _doc: - properties: - source: - type: keyword - content: - type: text + properties: + source: + type: keyword + content: + type: text - do: bulk: + include_type_name: false index: news - type: _doc refresh: true body: |''' @@ -392,20 +394,20 @@ buildRestTests.setups['news'] += """ buildRestTests.setups['exams'] = ''' - do: indices.create: + include_type_name: false index: exams body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - _doc: - properties: - grade: - type: byte + properties: + grade: + type: byte - do: bulk: + include_type_name: false index: exams - type: _doc refresh: true body: | {"index":{}} @@ -452,6 +454,7 @@ buildRestTests.setups['stored_scripted_metric_script'] = ''' buildRestTests.setups['analyze_sample'] = ''' - do: indices.create: + include_type_name: false index: analyze_sample body: settings: @@ -463,29 +466,28 @@ buildRestTests.setups['analyze_sample'] = ''' type: custom filter: [lowercase] mappings: - _doc: - properties: - obj1.field1: - type: text''' + properties: + obj1.field1: + type: text''' // Used by percentile/percentile-rank aggregations buildRestTests.setups['latency'] = ''' - do: indices.create: + include_type_name: false index: latency body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - _doc: - properties: - load_time: - type: long + properties: + load_time: + type: long - do: bulk: + include_type_name: false index: latency - type: _doc refresh: true body: |''' @@ -504,20 +506,20 @@ for (int i = 0; i < 100; i++) { buildRestTests.setups['iprange'] = ''' - do: indices.create: + include_type_name: false index: ip_addresses body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - _doc: - properties: - ip: - type: ip + properties: + ip: + type: ip - do: bulk: + include_type_name: false index: ip_addresses - type: _doc refresh: true body: |''' @@ -542,32 +544,32 @@ for (int i = 0; i < 5; i++) { buildRestTests.setups['library'] = ''' - do: indices.create: + include_type_name: false index: library body: settings: number_of_shards: 1 number_of_replicas: 1 mappings: - book: - properties: - name: - type: text - fields: - keyword: - type: keyword - author: - type: text - fields: - keyword: - type: keyword - release_date: - type: date - page_count: - type: short + properties: + name: + type: text + fields: + keyword: + type: keyword + author: + type: text + fields: + keyword: + type: keyword + release_date: + type: date + page_count: + type: short - do: bulk: + include_type_name: false index: library - type: book refresh: true body: | {"index":{"_id": "Leviathan Wakes"}} @@ -623,22 +625,22 @@ buildRestTests.setups['library'] = ''' buildRestTests.setups['sensor_rollup_job'] = ''' - do: indices.create: + include_type_name: false index: sensor-1 body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - _doc: - properties: - timestamp: - type: date - temperature: - type: long - voltage: - type: float - node: - type: keyword + properties: + timestamp: + type: date + temperature: + type: long + voltage: + type: float + node: + type: keyword - do: xpack.rollup.put_job: id: "sensor" @@ -673,27 +675,27 @@ buildRestTests.setups['sensor_rollup_job'] = ''' buildRestTests.setups['sensor_started_rollup_job'] = ''' - do: indices.create: + include_type_name: false index: sensor-1 body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - _doc: - properties: - timestamp: - type: date - temperature: - type: long - voltage: - type: float - node: - type: keyword + properties: + timestamp: + type: date + temperature: + type: long + voltage: + type: float + node: + type: keyword - do: bulk: + include_type_name: false index: sensor-1 - type: _doc refresh: true body: | {"index":{}} @@ -747,119 +749,119 @@ buildRestTests.setups['sensor_started_rollup_job'] = ''' buildRestTests.setups['sensor_index'] = ''' - do: indices.create: + include_type_name: false index: sensor-1 body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - _doc: - properties: - timestamp: - type: date - temperature: - type: long - voltage: - type: float - node: - type: keyword - load: - type: double - net_in: - type: long - net_out: - type: long - hostname: - type: keyword - datacenter: - type: keyword + properties: + timestamp: + type: date + temperature: + type: long + voltage: + type: float + node: + type: keyword + load: + type: double + net_in: + type: long + net_out: + type: long + hostname: + type: keyword + datacenter: + type: keyword ''' buildRestTests.setups['sensor_prefab_data'] = ''' - do: indices.create: + include_type_name: false index: sensor-1 body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - _doc: - properties: - timestamp: - type: date - temperature: - type: long - voltage: - type: float - node: - type: keyword + properties: + timestamp: + type: date + temperature: + type: long + voltage: + type: float + node: + type: keyword - do: indices.create: + include_type_name: false index: sensor_rollup body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - _doc: - properties: - node.terms.value: - type: keyword - temperature.sum.value: - type: double - temperature.max.value: - type: double - temperature.min.value: - type: double - timestamp.date_histogram.time_zone: - type: keyword - timestamp.date_histogram.interval: - type: keyword - timestamp.date_histogram.timestamp: - type: date - timestamp.date_histogram._count: - type: long - voltage.avg.value: - type: double - voltage.avg._count: - type: long - _rollup.id: - type: keyword - _rollup.version: - type: long - _meta: - _rollup: - sensor: - cron: "* * * * * ?" - rollup_index: "sensor_rollup" - index_pattern: "sensor-*" - timeout: "20s" - page_size: 1000 - groups: - date_histogram: - delay: "7d" - field: "timestamp" - interval: "1h" - time_zone: "UTC" - terms: - fields: - - "node" - id: sensor - metrics: - - field: "temperature" - metrics: - - min - - max - - sum - - field: "voltage" - metrics: - - avg + properties: + node.terms.value: + type: keyword + temperature.sum.value: + type: double + temperature.max.value: + type: double + temperature.min.value: + type: double + timestamp.date_histogram.time_zone: + type: keyword + timestamp.date_histogram.interval: + type: keyword + timestamp.date_histogram.timestamp: + type: date + timestamp.date_histogram._count: + type: long + voltage.avg.value: + type: double + voltage.avg._count: + type: long + _rollup.id: + type: keyword + _rollup.version: + type: long + _meta: + _rollup: + sensor: + cron: "* * * * * ?" + rollup_index: "sensor_rollup" + index_pattern: "sensor-*" + timeout: "20s" + page_size: 1000 + groups: + date_histogram: + delay: "7d" + field: "timestamp" + interval: "1h" + time_zone: "UTC" + terms: + fields: + - "node" + id: sensor + metrics: + - field: "temperature" + metrics: + - min + - max + - sum + - field: "voltage" + metrics: + - avg - do: bulk: + include_type_name: false index: sensor_rollup - type: _doc refresh: true body: | {"index":{}} @@ -899,28 +901,28 @@ buildRestTests.setups['sample_job'] = ''' buildRestTests.setups['farequote_index'] = ''' - do: indices.create: + include_type_name: false index: farequote body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - metric: - properties: - time: - type: date - responsetime: - type: float - airline: - type: keyword - doc_count: - type: integer + properties: + time: + type: date + responsetime: + type: float + airline: + type: keyword + doc_count: + type: integer ''' buildRestTests.setups['farequote_data'] = buildRestTests.setups['farequote_index'] + ''' - do: bulk: + include_type_name: false index: farequote - type: metric refresh: true body: | {"index": {"_id":"1"}} @@ -963,24 +965,24 @@ buildRestTests.setups['farequote_datafeed'] = buildRestTests.setups['farequote_j buildRestTests.setups['server_metrics_index'] = ''' - do: indices.create: + include_type_name: false index: server-metrics body: settings: number_of_shards: 1 number_of_replicas: 0 mappings: - metric: - properties: - timestamp: - type: date - total: - type: long + properties: + timestamp: + type: date + total: + type: long ''' buildRestTests.setups['server_metrics_data'] = buildRestTests.setups['server_metrics_index'] + ''' - do: bulk: + include_type_name: false index: server-metrics - type: metric refresh: true body: | {"index": {"_id":"1177"}} diff --git a/docs/reference/aggregations/bucket/adjacency-matrix-aggregation.asciidoc b/docs/reference/aggregations/bucket/adjacency-matrix-aggregation.asciidoc index 3e8117f41d4ce..b0a3849debe88 100644 --- a/docs/reference/aggregations/bucket/adjacency-matrix-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/adjacency-matrix-aggregation.asciidoc @@ -33,7 +33,7 @@ Example: [source,js] -------------------------------------------------- -PUT /emails/_doc/_bulk?refresh +PUT /emails/_bulk?refresh&include_type_name=false { "index" : { "_id" : 1 } } { "accounts" : ["hillary", "sidney"]} { "index" : { "_id" : 2 } } @@ -41,7 +41,7 @@ PUT /emails/_doc/_bulk?refresh { "index" : { "_id" : 3 } } { "accounts" : ["vladimir", "donald"]} -GET emails/_search +GET emails/_search?include_type_name=false { "size": 0, "aggs" : { diff --git a/docs/reference/aggregations/bucket/autodatehistogram-aggregation.asciidoc b/docs/reference/aggregations/bucket/autodatehistogram-aggregation.asciidoc index e371674228bb4..5386854ad0672 100644 --- a/docs/reference/aggregations/bucket/autodatehistogram-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/autodatehistogram-aggregation.asciidoc @@ -12,7 +12,7 @@ Requesting a target of 10 buckets. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sales_over_time" : { @@ -39,7 +39,7 @@ TIP: If no `format` is specified, then it will use the first date [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sales_over_time" : { @@ -121,22 +121,22 @@ Consider the following example: [source,js] --------------------------------- -PUT my_index/log/1?refresh +PUT my_index/_doc/1?refresh&include_type_name=false { "date": "2015-10-01T00:30:00Z" } -PUT my_index/log/2?refresh +PUT my_index/_doc/2?refresh&include_type_name=false { "date": "2015-10-01T01:30:00Z" } -PUT my_index/log/3?refresh +PUT my_index/_doc/3?refresh&include_type_name=false { "date": "2015-10-01T02:30:00Z" } -GET my_index/_search?size=0 +GET my_index/_search?size=0&include_type_name=false { "aggs": { "by_day": { @@ -188,7 +188,7 @@ midnight UTC: [source,js] --------------------------------- -GET my_index/_search?size=0 +GET my_index/_search?size=0&include_type_name=false { "aggs": { "by_day": { @@ -266,7 +266,7 @@ had a value. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sale_date" : { diff --git a/docs/reference/aggregations/bucket/children-aggregation.asciidoc b/docs/reference/aggregations/bucket/children-aggregation.asciidoc index e2b3c8ec59176..86062193b1d3c 100644 --- a/docs/reference/aggregations/bucket/children-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/children-aggregation.asciidoc @@ -11,16 +11,14 @@ For example, let's say we have an index of questions and answers. The answer typ [source,js] -------------------------------------------------- -PUT child_example +PUT child_example?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "join": { - "type": "join", - "relations": { - "question": "answer" - } + "properties": { + "join": { + "type": "join", + "relations": { + "question": "answer" } } } @@ -37,7 +35,7 @@ An example of a question document: [source,js] -------------------------------------------------- -PUT child_example/_doc/1 +PUT child_example/_doc/1?include_type_name=false { "join": { "name": "question" @@ -58,7 +56,7 @@ Examples of `answer` documents: [source,js] -------------------------------------------------- -PUT child_example/_doc/2?routing=1 +PUT child_example/_doc/2?routing=1&include_type_name=false { "join": { "name": "answer", @@ -73,7 +71,7 @@ PUT child_example/_doc/2?routing=1 "creation_date": "2009-05-04T13:45:37.030" } -PUT child_example/_doc/3?routing=1&refresh +PUT child_example/_doc/3?routing=1&refresh&include_type_name=false { "join": { "name": "answer", @@ -95,7 +93,7 @@ The following request can be built that connects the two together: [source,js] -------------------------------------------------- -POST child_example/_search?size=0 +POST child_example/_search?size=0&include_type_name=false { "aggs": { "top-tags": { diff --git a/docs/reference/aggregations/bucket/composite-aggregation.asciidoc b/docs/reference/aggregations/bucket/composite-aggregation.asciidoc index 0726f5f927e9f..2b864c32b1511 100644 --- a/docs/reference/aggregations/bucket/composite-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/composite-aggregation.asciidoc @@ -18,29 +18,27 @@ a composite bucket. [source,js] -------------------------------------------------- -PUT /sales +PUT /sales?include_type_name=false { "mappings": { - "docs": { - "properties": { - "product": { - "type": "keyword" - }, - "timestamp": { - "type": "date" - }, - "price": { - "type": "long" - }, - "shop": { - "type": "keyword" - } + "properties": { + "product": { + "type": "keyword" + }, + "timestamp": { + "type": "date" + }, + "price": { + "type": "long" + }, + "shop": { + "type": "keyword" } } } } -POST /sales/docs/_bulk?refresh +POST /sales/_bulk?refresh&include_type_name=false {"index":{"_id":0}} {"product": "mad max", "price": "20", "timestamp": "2017-05-09T14:35"} {"index":{"_id":1}} @@ -96,7 +94,7 @@ Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -115,7 +113,7 @@ Like the `terms` aggregation it is also possible to use a script to create the v [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -150,7 +148,7 @@ Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -169,7 +167,7 @@ The values are built from a numeric field or a script that return numerical valu [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -202,7 +200,7 @@ is specified by date/time expression: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -232,7 +230,7 @@ the format specified with the format parameter: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -275,7 +273,7 @@ For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -299,7 +297,7 @@ in the composite buckets. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -329,7 +327,7 @@ For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -356,7 +354,7 @@ It is possible to include them in the response by setting `missing_bucket` to [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -396,7 +394,7 @@ For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -462,7 +460,7 @@ round of result can be retrieved with: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { @@ -492,7 +490,7 @@ per composite bucket: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "my_buckets": { diff --git a/docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc b/docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc index 1d185e80f4f96..61dce0418a9b3 100644 --- a/docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc @@ -12,7 +12,7 @@ Requesting bucket intervals of a month. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sales_over_time" : { @@ -37,7 +37,7 @@ days do not support arbitrary values but can only be one unit large (e.g. `1y` i [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sales_over_time" : { @@ -64,7 +64,7 @@ TIP: If no `format` is specified, then it will use the first date [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sales_over_time" : { @@ -127,17 +127,17 @@ Consider the following example: [source,js] --------------------------------- -PUT my_index/_doc/1?refresh +PUT my_index/_doc/1?refresh&include_type_name=false { "date": "2015-10-01T00:30:00Z" } -PUT my_index/_doc/2?refresh +PUT my_index/_doc/2?refresh&include_type_name=false { "date": "2015-10-01T01:30:00Z" } -GET my_index/_search?size=0 +GET my_index/_search?size=0&include_type_name=false { "aggs": { "by_day": { @@ -179,7 +179,7 @@ midnight UTC: [source,js] --------------------------------- -GET my_index/_search?size=0 +GET my_index/_search?size=0&include_type_name=false { "aggs": { "by_day": { @@ -249,17 +249,17 @@ to run from 6am to 6am: [source,js] ----------------------------- -PUT my_index/_doc/1?refresh +PUT my_index/_doc/1?refresh&include_type_name=false { "date": "2015-10-01T05:30:00Z" } -PUT my_index/_doc/2?refresh +PUT my_index/_doc/2?refresh&include_type_name=false { "date": "2015-10-01T06:30:00Z" } -GET my_index/_search?size=0 +GET my_index/_search?size=0&include_type_name=false { "aggs": { "by_day": { @@ -310,7 +310,7 @@ Setting the `keyed` flag to `true` will associate a unique string key with each [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sales_over_time" : { @@ -375,7 +375,7 @@ had a value. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "sale_date" : { @@ -409,7 +409,7 @@ In this case to overcome the problem, we can use a script that returns the day o [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs": { "dayOfWeek": { diff --git a/docs/reference/aggregations/bucket/daterange-aggregation.asciidoc b/docs/reference/aggregations/bucket/daterange-aggregation.asciidoc index 4b172402da9ec..896c0714fb605 100644 --- a/docs/reference/aggregations/bucket/daterange-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/daterange-aggregation.asciidoc @@ -14,7 +14,7 @@ Example: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs": { "range": { @@ -77,7 +77,7 @@ value mappings to specify default values per field. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs": { "range": { @@ -189,7 +189,7 @@ can do the following: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs": { "range": { @@ -219,7 +219,7 @@ bucket and return the ranges as a hash rather than an array: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs": { "range": { @@ -269,7 +269,7 @@ It is also possible to customize the key for each range: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs": { "range": { diff --git a/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc b/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc index 970a2ffdc1e33..75cc55c91d29b 100644 --- a/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc @@ -28,7 +28,7 @@ forum posts but ignoring the effects of some prolific users with a tendency to m [source,js] -------------------------------------------------- -POST /stackoverflow/_search?size=0 +POST /stackoverflow/_search?size=0&include_type_name=false { "query": { "query_string": { @@ -94,7 +94,7 @@ multiple values in a tags field to ensure we don't have a sample that consists o [source,js] -------------------------------------------------- -POST /stackoverflow/_search?size=0 +POST /stackoverflow/_search?size=0&include_type_name=false { "query": { "query_string": { diff --git a/docs/reference/aggregations/bucket/filter-aggregation.asciidoc b/docs/reference/aggregations/bucket/filter-aggregation.asciidoc index bff4096e2dd3a..df284d8a59b40 100644 --- a/docs/reference/aggregations/bucket/filter-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/filter-aggregation.asciidoc @@ -7,7 +7,7 @@ Example: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "t_shirts" : { diff --git a/docs/reference/aggregations/bucket/filters-aggregation.asciidoc b/docs/reference/aggregations/bucket/filters-aggregation.asciidoc index b7e3b1edf10d2..66b316883d527 100644 --- a/docs/reference/aggregations/bucket/filters-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/filters-aggregation.asciidoc @@ -9,7 +9,7 @@ Example: [source,js] -------------------------------------------------- -PUT /logs/_doc/_bulk?refresh +PUT /logs/_bulk?refresh&include_type_name=false { "index" : { "_id" : 1 } } { "body" : "warning: page could not be rendered" } { "index" : { "_id" : 2 } } @@ -17,7 +17,7 @@ PUT /logs/_doc/_bulk?refresh { "index" : { "_id" : 3 } } { "body" : "warning: connection timed out" } -GET logs/_search +GET logs/_search?include_type_name=false { "size": 0, "aggs" : { @@ -72,7 +72,7 @@ following request: [source,js] -------------------------------------------------- -GET logs/_search +GET logs/_search?include_type_name=false { "size": 0, "aggs" : { @@ -134,12 +134,12 @@ The following snippet shows a response where the `other` bucket is requested to [source,js] -------------------------------------------------- -PUT logs/_doc/4?refresh +PUT logs/_doc/4?refresh&include_type_name=false { "body": "info: user Bob logged out" } -GET logs/_search +GET logs/_search?include_type_name=false { "size": 0, "aggs" : { diff --git a/docs/reference/aggregations/bucket/geodistance-aggregation.asciidoc b/docs/reference/aggregations/bucket/geodistance-aggregation.asciidoc index c60f8413e462a..736ce4782578b 100644 --- a/docs/reference/aggregations/bucket/geodistance-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/geodistance-aggregation.asciidoc @@ -5,20 +5,18 @@ A multi-bucket aggregation that works on `geo_point` fields and conceptually wor [source,js] -------------------------------------------------- -PUT /museums +PUT museums?include_type_name=false { "mappings": { - "doc": { - "properties": { - "location": { - "type": "geo_point" - } + "properties": { + "location": { + "type": "geo_point" } } } } -POST /museums/doc/_bulk?refresh +POST /museums/_bulk?refresh&include_type_name=false {"index":{"_id":1}} {"location": "52.374081,4.912350", "name": "NEMO Science Museum"} {"index":{"_id":2}} @@ -32,7 +30,7 @@ POST /museums/doc/_bulk?refresh {"index":{"_id":6}} {"location": "48.860000,2.327000", "name": "Musée d'Orsay"} -POST /museums/_search?size=0 +POST museums/_search?size=0&include_type_name=false { "aggs" : { "rings_around_amsterdam" : { @@ -94,7 +92,7 @@ By default, the distance unit is `m` (meters) but it can also accept: `mi` (mile [source,js] -------------------------------------------------- -POST /museums/_search?size=0 +POST /museums/_search?size=0&include_type_name=false { "aggs" : { "rings" : { @@ -121,7 +119,7 @@ There are two distance calculation modes: `arc` (the default), and `plane`. The [source,js] -------------------------------------------------- -POST /museums/_search?size=0 +POST museums/_search?size=0&include_type_name=false { "aggs" : { "rings" : { @@ -149,7 +147,7 @@ Setting the `keyed` flag to `true` will associate a unique string key with each [source,js] -------------------------------------------------- -POST /museums/_search?size=0 +POST museums/_search?size=0&include_type_name=false { "aggs" : { "rings_around_amsterdam" : { @@ -204,7 +202,7 @@ It is also possible to customize the key for each range: [source,js] -------------------------------------------------- -POST /museums/_search?size=0 +POST museums/_search?size=0&include_type_name=false { "aggs" : { "rings_around_amsterdam" : { diff --git a/docs/reference/aggregations/bucket/geohashgrid-aggregation.asciidoc b/docs/reference/aggregations/bucket/geohashgrid-aggregation.asciidoc index c9f05e36f98dd..24570fd750e18 100644 --- a/docs/reference/aggregations/bucket/geohashgrid-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/geohashgrid-aggregation.asciidoc @@ -19,20 +19,18 @@ The specified field must be of type `geo_point` (which can only be set explicitl [source,js] -------------------------------------------------- -PUT /museums +PUT /museums?include_type_name=false { "mappings": { - "doc": { - "properties": { - "location": { - "type": "geo_point" - } + "properties": { + "location": { + "type": "geo_point" } } } } -POST /museums/doc/_bulk?refresh +POST /museums/_bulk?refresh&include_type_name=false {"index":{"_id":1}} {"location": "52.374081,4.912350", "name": "NEMO Science Museum"} {"index":{"_id":2}} @@ -46,7 +44,7 @@ POST /museums/doc/_bulk?refresh {"index":{"_id":6}} {"location": "48.860000,2.327000", "name": "Musée d'Orsay"} -POST /museums/_search?size=0 +POST /museums/_search?size=0&include_type_name=false { "aggregations" : { "large-grid" : { @@ -94,7 +92,7 @@ When requesting detailed buckets (typically for displaying a "zoomed in" map) a [source,js] -------------------------------------------------- -POST /museums/_search?size=0 +POST /museums/_search?size=0&include_type_name=false { "aggregations" : { "zoomed-in" : { diff --git a/docs/reference/aggregations/bucket/global-aggregation.asciidoc b/docs/reference/aggregations/bucket/global-aggregation.asciidoc index affabc5067e66..ad8383e4badb6 100644 --- a/docs/reference/aggregations/bucket/global-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/global-aggregation.asciidoc @@ -13,7 +13,7 @@ Example: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "query" : { "match" : { "type" : "t-shirt" } diff --git a/docs/reference/aggregations/bucket/histogram-aggregation.asciidoc b/docs/reference/aggregations/bucket/histogram-aggregation.asciidoc index 2576662b6d13f..ebfad4d6f4281 100644 --- a/docs/reference/aggregations/bucket/histogram-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/histogram-aggregation.asciidoc @@ -21,7 +21,7 @@ The following snippet "buckets" the products based on their `price` by interval [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "prices" : { @@ -80,7 +80,7 @@ a higher minimum count thanks to the `min_doc_count` setting: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "prices" : { @@ -156,7 +156,7 @@ Example: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "query" : { "constant_score" : { "filter": { "range" : { "price" : { "to" : "500" } } } } @@ -199,7 +199,7 @@ instead keyed by the buckets keys: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "prices" : { @@ -259,7 +259,7 @@ had a value. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "quantity" : { diff --git a/docs/reference/aggregations/bucket/iprange-aggregation.asciidoc b/docs/reference/aggregations/bucket/iprange-aggregation.asciidoc index 0aabd3a71ed30..c9276b685ae8c 100644 --- a/docs/reference/aggregations/bucket/iprange-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/iprange-aggregation.asciidoc @@ -7,7 +7,7 @@ Example: [source,js] -------------------------------------------------- -GET /ip_addresses/_search +GET /ip_addresses/_search?include_type_name=false { "size": 10, "aggs" : { @@ -57,7 +57,7 @@ IP ranges can also be defined as CIDR masks: [source,js] -------------------------------------------------- -GET /ip_addresses/_search +GET /ip_addresses/_search?include_type_name=false { "size": 0, "aggs" : { @@ -111,7 +111,7 @@ Setting the `keyed` flag to `true` will associate a unique string key with each [source,js] -------------------------------------------------- -GET /ip_addresses/_search +GET /ip_addresses/_search?include_type_name=false { "size": 0, "aggs": { @@ -160,7 +160,7 @@ It is also possible to customize the key for each range: [source,js] -------------------------------------------------- -GET /ip_addresses/_search +GET /ip_addresses/_search?include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/aggregations/bucket/missing-aggregation.asciidoc b/docs/reference/aggregations/bucket/missing-aggregation.asciidoc index b670529119673..41bdb83639cbd 100644 --- a/docs/reference/aggregations/bucket/missing-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/missing-aggregation.asciidoc @@ -7,7 +7,7 @@ Example: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "products_without_a_price" : { @@ -34,4 +34,4 @@ Response: } } -------------------------------------------------- -// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/] \ No newline at end of file +// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/] diff --git a/docs/reference/aggregations/bucket/nested-aggregation.asciidoc b/docs/reference/aggregations/bucket/nested-aggregation.asciidoc index 5d2d904f0eb7f..04d5dde800ec9 100644 --- a/docs/reference/aggregations/bucket/nested-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/nested-aggregation.asciidoc @@ -8,19 +8,17 @@ price for the product. The mapping could look like: [source,js] -------------------------------------------------- -PUT /index +PUT /index?include_type_name=false { "mappings": { - "product" : { + "properties" : { + "resellers" : { <1> + "type" : "nested", "properties" : { - "resellers" : { <1> - "type" : "nested", - "properties" : { - "name" : { "type" : "text" }, - "price" : { "type" : "double" } - } - } + "name" : { "type" : "text" }, + "price" : { "type" : "double" } } + } } } } @@ -33,7 +31,7 @@ The following aggregations will return the minimum price products can be purchas [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match" : { "name" : "led tv" } @@ -51,8 +49,8 @@ GET /_search } -------------------------------------------------- // CONSOLE -// TEST[s/GET \/_search/GET \/_search\?filter_path=aggregations/] -// TEST[s/^/PUT index\/product\/0\?refresh\n{"name":"led", "resellers": [{"name": "foo", "price": 350.00}, {"name": "bar", "price": 500.00}]}\n/] +// TEST[s/GET \/_search\?/GET \/_search\?filter_path=aggregations&/] +// TEST[s/^/PUT index\/_doc\/0\?refresh&include_type_name=false\n{"name":"led", "resellers": [{"name": "foo", "price": 350.00}, {"name": "bar", "price": 500.00}]}\n/] As you can see above, the nested aggregation requires the `path` of the nested documents within the top level documents. Then one can define any type of aggregation over these nested documents. diff --git a/docs/reference/aggregations/bucket/range-aggregation.asciidoc b/docs/reference/aggregations/bucket/range-aggregation.asciidoc index 8ff26c7c92f5c..adeabdf9c4c6f 100644 --- a/docs/reference/aggregations/bucket/range-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/range-aggregation.asciidoc @@ -8,7 +8,7 @@ Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -26,7 +26,7 @@ GET /_search -------------------------------------------------- // CONSOLE // TEST[setup:sales] -// TEST[s/GET \/_search/GET \/_search\?filter_path=aggregations/] +// TEST[s/GET \/_search\?/GET \/_search\?filter_path=aggregations&/] Response: @@ -66,7 +66,7 @@ Setting the `keyed` flag to `true` will associate a unique string key with each [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -120,7 +120,7 @@ It is also possible to customize the key for each range: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -179,7 +179,7 @@ The following example shows how to use an `inline` script with the `painless` sc [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -219,7 +219,7 @@ And this new stored script can be used in the range aggregation like this: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -280,7 +280,7 @@ Lets say the product prices are in USD but we would like to get the price ranges [source,js] -------------------------------------------------- -GET /sales/_search +GET /sales/_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -311,7 +311,7 @@ The following example, not only "bucket" the documents to the different buckets [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { @@ -393,7 +393,7 @@ If a sub aggregation is also based on the same value source as the range aggrega [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "price_ranges" : { diff --git a/docs/reference/aggregations/bucket/reverse-nested-aggregation.asciidoc b/docs/reference/aggregations/bucket/reverse-nested-aggregation.asciidoc index f45629b14e746..01711571a9038 100644 --- a/docs/reference/aggregations/bucket/reverse-nested-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/reverse-nested-aggregation.asciidoc @@ -55,7 +55,7 @@ POST /issues/issue/0?refresh [source,js] -------------------------------------------------- -GET /issues/_search +GET /issues/_search?include_type_name=false { "query": { "match_all": {} diff --git a/docs/reference/aggregations/bucket/sampler-aggregation.asciidoc b/docs/reference/aggregations/bucket/sampler-aggregation.asciidoc index c5ac91e9d3ad8..13ce248e6bf1d 100644 --- a/docs/reference/aggregations/bucket/sampler-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/sampler-aggregation.asciidoc @@ -17,7 +17,7 @@ the most interesting parts of our query we use a sample. [source,js] -------------------------------------------------- -POST /stackoverflow/_search?size=0 +POST /stackoverflow/_search?size=0&include_type_name=false { "query": { "query_string": { @@ -87,7 +87,7 @@ less significant terms such as `jquery` and `angular` rather than focusing on th [source,js] -------------------------------------------------- -POST /stackoverflow/_search?size=0 +POST /stackoverflow/_search?size=0&include_type_name=false { "query": { "query_string": { @@ -158,4 +158,4 @@ The default value is 100. ===== Cannot be nested under `breadth_first` aggregations Being a quality-based filter the sampler aggregation needs access to the relevance score produced for each document. It therefore cannot be nested under a `terms` aggregation which has the `collect_mode` switched from the default `depth_first` mode to `breadth_first` as this discards scores. -In this situation an error will be thrown. \ No newline at end of file +In this situation an error will be thrown. diff --git a/docs/reference/aggregations/bucket/significantterms-aggregation.asciidoc b/docs/reference/aggregations/bucket/significantterms-aggregation.asciidoc index 0a8a46a0b67b6..a657e0c8b6232 100644 --- a/docs/reference/aggregations/bucket/significantterms-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/significantterms-aggregation.asciidoc @@ -19,23 +19,21 @@ that is significant and probably very relevant to their search. 5/10,000,000 vs [source,js] -------------------------------------------------- -PUT /reports +PUT /reports?include_type_name=false { "mappings": { - "report": { - "properties": { - "force": { - "type": "keyword" - }, - "crime_type": { - "type": "keyword" - } + "properties": { + "force": { + "type": "keyword" + }, + "crime_type": { + "type": "keyword" } } } } -POST /reports/report/_bulk?refresh +POST /reports/_bulk?refresh&include_type_name=false {"index":{"_id":0}} {"force": "British Transport Police", "crime_type": "Bicycle theft"} {"index":{"_id":1}} @@ -68,7 +66,7 @@ Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "terms" : {"force" : [ "British Transport Police" ]} @@ -129,7 +127,7 @@ Example using a parent aggregation for segmentation: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggregations": { "forces": { @@ -207,7 +205,7 @@ area to identify unusual hot-spots of a particular crime type: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs": { "hotspots": { @@ -467,7 +465,7 @@ It is possible to only return terms that match more than a configured number of [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "tags" : { @@ -510,7 +508,7 @@ context: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match" : { @@ -563,7 +561,7 @@ ordinals. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "tags" : { diff --git a/docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc b/docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc index fa4d94c232784..1072ed8a20f7e 100644 --- a/docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc @@ -38,7 +38,7 @@ Example: [source,js] -------------------------------------------------- -GET news/_search +GET news/_search?include_type_name=false { "query" : { "match" : {"content" : "Bird flu"} @@ -153,7 +153,7 @@ We can drill down into examples of these documents to see why pozmantier is conn [source,js] -------------------------------------------------- -GET news/_search +GET news/_search?include_type_name=false { "query": { "simple_query_string": { @@ -221,7 +221,7 @@ with the `filter_duplicate_text` setting turned on: [source,js] -------------------------------------------------- -GET news/_search +GET news/_search?include_type_name=false { "query": { "match": { @@ -424,7 +424,7 @@ context: [source,js] -------------------------------------------------- -GET news/_search +GET news/_search?include_type_name=false { "query" : { "match" : { @@ -463,7 +463,7 @@ will be analyzed using the `source_fields` parameter: [source,js] -------------------------------------------------- -GET news/_search +GET news/_search?include_type_name=false { "query" : { "match" : { diff --git a/docs/reference/aggregations/bucket/terms-aggregation.asciidoc b/docs/reference/aggregations/bucket/terms-aggregation.asciidoc index f42d176aea06c..1a2608484460a 100644 --- a/docs/reference/aggregations/bucket/terms-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/terms-aggregation.asciidoc @@ -7,23 +7,21 @@ A multi-bucket value source based aggregation where buckets are dynamically buil [source,js] -------------------------------------------------- -PUT /products +PUT /products?include_type_name=false { "mappings": { - "product": { - "properties": { - "genre": { - "type": "keyword" - }, - "product": { - "type": "keyword" - } + "properties": { + "genre": { + "type": "keyword" + }, + "product": { + "type": "keyword" } } } } -POST /products/product/_bulk?refresh +POST /products/_bulk?refresh&include_type_name=false {"index":{"_id":0}} {"genre": "rock", "product": "Product A"} {"index":{"_id":1}} @@ -57,7 +55,7 @@ Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "genres" : { @@ -132,7 +130,7 @@ A request is made to obtain the top 5 terms in the field product, ordered by des [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "products" : { @@ -263,7 +261,7 @@ The second error value can be enabled by setting the `show_term_doc_count_error` [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "products" : { @@ -341,7 +339,7 @@ Ordering the buckets by their doc `_count` in an ascending manner: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "genres" : { @@ -359,7 +357,7 @@ Ordering the buckets alphabetically by their terms in an ascending manner: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "genres" : { @@ -379,7 +377,7 @@ Ordering the buckets by single value metrics sub-aggregation (identified by the [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "genres" : { @@ -400,7 +398,7 @@ Ordering the buckets by multi value metrics sub-aggregation (identified by the a [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "aggs" : { "genres" : { @@ -447,7 +445,7 @@ PATH = [ , ]* [ - "type" : "nested", - "properties" : { - "username" : { "type" : "keyword" }, - "comment" : { "type" : "text" } - } + "properties" : { + "tags" : { "type" : "keyword" }, + "comments" : { <1> + "type" : "nested", + "properties" : { + "username" : { "type" : "keyword" }, + "comment" : { "type" : "text" } } } } @@ -256,7 +251,7 @@ And some documents: [source,js] -------------------------------------------------- -PUT /sales/_doc/1?refresh +PUT /sales/_doc/1?refresh&include_type_name=false { "tags": ["car", "auto"], "comments": [ @@ -273,7 +268,7 @@ It's now possible to execute the following `top_hits` aggregation (wrapped in a [source,js] -------------------------------------------------- -POST /sales/_search +POST /sales/_search?include_type_name=false { "query": { "term": { "tags": "car" } @@ -302,7 +297,7 @@ POST /sales/_search -------------------------------------------------- // CONSOLE // TEST[continued] -// TEST[s/_search/_search\?filter_path=aggregations.by_sale.by_user.buckets/] +// TEST[s/_search\?/_search\?filter_path=aggregations.by_sale.by_user.buckets&/] Top hits response snippet with a nested hit, which resides in the first slot of array field `comments`: @@ -324,7 +319,6 @@ Top hits response snippet with a nested hit, which resides in the first slot of "hits": [ { "_index": "sales", - "_type" : "_doc", "_id": "1", "_nested": { "field": "comments", <1> @@ -374,7 +368,6 @@ the second slow of the `nested_child_field` field: "hits": [ { "_index": "a", - "_type": "b", "_id": "1", "_score": 1, "_nested" : { diff --git a/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc b/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc index 8d5c72994c4a5..81851fcb21251 100644 --- a/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc @@ -8,7 +8,7 @@ one might be interested in the number of values the average is computed over. [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "types_count" : { "value_count" : { "field" : "type" } } @@ -42,7 +42,7 @@ Counting the values generated by a script: [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "type_count" : { @@ -62,7 +62,7 @@ This will interpret the `script` parameter as an `inline` script with the `painl [source,js] -------------------------------------------------- -POST /sales/_search?size=0 +POST /sales/_search?size=0&include_type_name=false { "aggs" : { "types_count" : { diff --git a/docs/reference/aggregations/metrics/weighted-avg-aggregation.asciidoc b/docs/reference/aggregations/metrics/weighted-avg-aggregation.asciidoc index 252728a6db367..496d44f4a2077 100644 --- a/docs/reference/aggregations/metrics/weighted-avg-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/weighted-avg-aggregation.asciidoc @@ -47,7 +47,7 @@ we can calculate the weighted average using: [source,js] -------------------------------------------------- -POST /exams/_search +POST /exams/_search?include_type_name=false { "size": 0, "aggs" : { @@ -100,7 +100,7 @@ POST /exams/_doc?refresh "weight": 2 } -POST /exams/_search +POST /exams/_search?include_type_name=false { "size": 0, "aggs" : { @@ -145,7 +145,7 @@ will add one to the grade and weight in the document using a script: [source,js] -------------------------------------------------- -POST /exams/_search +POST /exams/_search?include_type_name=false { "size": 0, "aggs" : { @@ -178,7 +178,7 @@ Both of these defaults can be overridden with the `missing` parameter: [source,js] -------------------------------------------------- -POST /exams/_search +POST /exams/_search?include_type_name=false { "size": 0, "aggs" : { diff --git a/docs/reference/aggregations/misc.asciidoc b/docs/reference/aggregations/misc.asciidoc index 20d234302a684..9c83131355810 100644 --- a/docs/reference/aggregations/misc.asciidoc +++ b/docs/reference/aggregations/misc.asciidoc @@ -17,7 +17,7 @@ setting `size=0`. For example: [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "size": 0, "aggregations": { @@ -44,7 +44,7 @@ Consider this example where we want to associate the color blue with our `terms` [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "size": 0, "aggs": { @@ -96,7 +96,7 @@ Considering the following <> [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -331,7 +331,7 @@ The Holt-Linear model can be <> [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -420,7 +420,7 @@ The additive Holt-Winters model can be <> [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -481,7 +481,7 @@ you can disable this behavior with `pad: false` [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -531,7 +531,7 @@ as your buckets: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -610,7 +610,7 @@ Minimization is enabled/disabled via the `minimize` parameter: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/aggregations/pipeline/movfn-aggregation.asciidoc b/docs/reference/aggregations/pipeline/movfn-aggregation.asciidoc index 09fa707c5db3b..698280f473e43 100644 --- a/docs/reference/aggregations/pipeline/movfn-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/movfn-aggregation.asciidoc @@ -36,7 +36,7 @@ embedded like any other metric aggregation: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -138,7 +138,7 @@ For example, this script will simply return the first value from the window, or [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -195,7 +195,7 @@ is only calculated over the real values. If the window is empty, or all values a [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -236,7 +236,7 @@ is only calculated over the real values. If the window is empty, or all values a [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -277,7 +277,7 @@ the sum is only calculated over the real values. If the window is empty, or all [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -320,7 +320,7 @@ This function accepts a collection of doubles and average, then returns the stan [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -370,7 +370,7 @@ values. [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -414,7 +414,7 @@ If the window is empty, or all values are `null`/`NaN`, `NaN` is returned as the [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -464,7 +464,7 @@ values. [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -520,7 +520,7 @@ values. [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { @@ -584,7 +584,7 @@ values. [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc b/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc index 6c4329f6f20d0..4c56e0840806c 100644 --- a/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc @@ -33,7 +33,7 @@ The following snippet calculates the percentiles for the total monthly `sales` b [source,js] -------------------------------------------------- -POST /sales/_search +POST /sales/_search?include_type_name=false { "size": 0, "aggs" : { diff --git a/docs/reference/aggregations/pipeline/serial-diff-aggregation.asciidoc b/docs/reference/aggregations/pipeline/serial-diff-aggregation.asciidoc index 70aea68f88c34..159820925744d 100644 --- a/docs/reference/aggregations/pipeline/serial-diff-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/serial-diff-aggregation.asciidoc @@ -60,7 +60,7 @@ A `serial_diff` aggregation looks like this in isolation: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/aggregations/pipeline/stats-bucket-aggregation.asciidoc b/docs/reference/aggregations/pipeline/stats-bucket-aggregation.asciidoc index b9c52ae981f75..c136e7b82ad21 100644 --- a/docs/reference/aggregations/pipeline/stats-bucket-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/stats-bucket-aggregation.asciidoc @@ -32,7 +32,7 @@ The following snippet calculates the stats for monthly `sales`: [source,js] -------------------------------------------------- -POST /sales/_search +POST /sales/_search?include_type_name=false { "size": 0, "aggs" : { diff --git a/docs/reference/aggregations/pipeline/sum-bucket-aggregation.asciidoc b/docs/reference/aggregations/pipeline/sum-bucket-aggregation.asciidoc index b39cf472323c2..5a806f00c33b6 100644 --- a/docs/reference/aggregations/pipeline/sum-bucket-aggregation.asciidoc +++ b/docs/reference/aggregations/pipeline/sum-bucket-aggregation.asciidoc @@ -32,7 +32,7 @@ The following snippet calculates the sum of all the total monthly `sales` bucket [source,js] -------------------------------------------------- -POST /sales/_search +POST /sales/_search?include_type_name=false { "size": 0, "aggs" : { diff --git a/docs/reference/analysis/charfilters/pattern-replace-charfilter.asciidoc b/docs/reference/analysis/charfilters/pattern-replace-charfilter.asciidoc index a998e6b11f9ab..f1a096e1f54b2 100644 --- a/docs/reference/analysis/charfilters/pattern-replace-charfilter.asciidoc +++ b/docs/reference/analysis/charfilters/pattern-replace-charfilter.asciidoc @@ -100,7 +100,7 @@ camelCase words to be queried individually: [source,js] ---------------------------- -PUT my_index +PUT my_index?include_type_name=false { "settings": { "analysis": { @@ -125,12 +125,10 @@ PUT my_index } }, "mappings": { - "_doc": { - "properties": { - "text": { - "type": "text", - "analyzer": "my_analyzer" - } + "properties": { + "text": { + "type": "text", + "analyzer": "my_analyzer" } } } @@ -205,12 +203,12 @@ the length of the original text: [source,js] ---------------------------- -PUT my_index/_doc/1?refresh +PUT my_index/_doc/1?refresh&include_type_name=false { "text": "The fooBarBaz method" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { @@ -246,7 +244,6 @@ The output from the above is: "hits": [ { "_index": "my_index", - "_type": "_doc", "_id": "1", "_score": 0.2876821, "_source": { diff --git a/docs/reference/analysis/tokenizers/edgengram-tokenizer.asciidoc b/docs/reference/analysis/tokenizers/edgengram-tokenizer.asciidoc index 9b6861627be40..8c9a4a0f5b3e7 100644 --- a/docs/reference/analysis/tokenizers/edgengram-tokenizer.asciidoc +++ b/docs/reference/analysis/tokenizers/edgengram-tokenizer.asciidoc @@ -222,7 +222,7 @@ Below is an example of how to set up a field for _search-as-you-type_: [source,js] ----------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "settings": { "analysis": { @@ -250,26 +250,24 @@ PUT my_index } }, "mappings": { - "_doc": { - "properties": { - "title": { - "type": "text", - "analyzer": "autocomplete", - "search_analyzer": "autocomplete_search" - } + "properties": { + "title": { + "type": "text", + "analyzer": "autocomplete", + "search_analyzer": "autocomplete_search" } } } } -PUT my_index/_doc/1 +PUT my_index/_doc/1?include_type_name=false { "title": "Quick Foxes" <1> } POST my_index/_refresh -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { @@ -305,7 +303,6 @@ GET my_index/_search "hits": [ { "_index": "my_index", - "_type": "_doc", "_id": "1", "_score": 0.5753642, "_source": { diff --git a/docs/reference/api-conventions.asciidoc b/docs/reference/api-conventions.asciidoc index 42216a9a0fc14..c6a7ba3f483fe 100644 --- a/docs/reference/api-conventions.asciidoc +++ b/docs/reference/api-conventions.asciidoc @@ -90,8 +90,8 @@ all special characters should be URI encoded. For example: [source,js] ---------------------------------------------------------------------- -# GET //_search -GET /%3Clogstash-%7Bnow%2Fd%7D%3E/_search +# GET //_search?include_type_name=false +GET /%3Clogstash-%7Bnow%2Fd%7D%3E/_search?include_type_name=false { "query" : { "match": { @@ -145,8 +145,8 @@ three days, assuming the indices use the default Logstash index name format, [source,js] ---------------------------------------------------------------------- -# GET /,,/_search -GET /%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E/_search +# GET /,,/_search?include_type_name=false +GET /%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E/_search?include_type_name=false { "query" : { "match": { @@ -232,7 +232,7 @@ separated list of filters expressed with the dot notation: [source,js] -------------------------------------------------- -GET /_search?q=elasticsearch&filter_path=took,hits.hits._id,hits.hits._score +GET /_search?q=elasticsearch&filter_path=took,hits.hits._id,hits.hits._score&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] @@ -363,13 +363,13 @@ parameter like this: [source,js] -------------------------------------------------- -POST /library/book?refresh +POST /library/_doc?refresh&include_type_name=false {"title": "Book #1", "rating": 200.1} -POST /library/book?refresh +POST /library/_doc?refresh&include_type_name=false {"title": "Book #2", "rating": 1.7} -POST /library/book?refresh +POST /library/_doc?refresh&include_type_name=false {"title": "Book #3", "rating": 0.1} -GET /_search?filter_path=hits.hits._source&_source=title&sort=rating:desc +GET /_search?filter_path=hits.hits._source&_source=title&sort=rating:desc&include_type_name=false -------------------------------------------------- // CONSOLE @@ -594,7 +594,7 @@ invalid `size` parameter to the `_search` API: [source,js] ---------------------------------------------------------------------- -POST /twitter/_search?size=surprise_me +POST /twitter/_search?size=surprise_me&include_type_name=false ---------------------------------------------------------------------- // CONSOLE // TEST[s/surprise_me/surprise_me&error_trace=false/ catch:bad_request] @@ -628,7 +628,7 @@ But if you set `error_trace=true`: [source,js] ---------------------------------------------------------------------- -POST /twitter/_search?size=surprise_me&error_trace=true +POST /twitter/_search?size=surprise_me&error_trace=true&include_type_name=false ---------------------------------------------------------------------- // CONSOLE // TEST[catch:bad_request] diff --git a/docs/reference/cat/fielddata.asciidoc b/docs/reference/cat/fielddata.asciidoc index 19b08a5792942..f9c58287a1193 100644 --- a/docs/reference/cat/fielddata.asciidoc +++ b/docs/reference/cat/fielddata.asciidoc @@ -9,31 +9,29 @@ on every data node in the cluster. Hidden setup snippet to build an index with fielddata so our results are real: [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "mappings": { - "test": { - "properties": { - "body": { - "type": "text", - "fielddata":true - }, - "soul": { - "type": "text", - "fielddata":true - } + "properties": { + "body": { + "type": "text", + "fielddata":true + }, + "soul": { + "type": "text", + "fielddata":true } } } } -POST test/test?refresh +POST test/_doc?refresh&include_type_name=false { "body": "some words so there is a little field data", "soul": "some more words" } # Perform a search to load the field data -POST test/_search?sort=body,soul +POST test/_search?sort=body,soul&include_type_name=false -------------------------------------------------- // CONSOLE //// diff --git a/docs/reference/docs/bulk.asciidoc b/docs/reference/docs/bulk.asciidoc index 4c6e55af318f5..867be6e5eb018 100644 --- a/docs/reference/docs/bulk.asciidoc +++ b/docs/reference/docs/bulk.asciidoc @@ -57,10 +57,10 @@ newlines. Example: [source,js] -------------------------------------------------- $ cat requests -{ "index" : { "_index" : "test", "_type" : "_doc", "_id" : "1" } } +{ "index" : { "_index" : "test", "_id" : "1" } } { "field1" : "value1" } -$ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@requests"; echo -{"took":7, "errors": false, "items":[{"index":{"_index":"test","_type":"_doc","_id":"1","_version":1,"result":"created","forced_refresh":false}}]} +$ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk?include_type_name=false --data-binary "@requests"; echo +{"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]} -------------------------------------------------- // NOTCONSOLE // Not converting to console because this shows how curl works @@ -71,13 +71,13 @@ example of a correct sequence of bulk commands: [source,js] -------------------------------------------------- -POST _bulk -{ "index" : { "_index" : "test", "_type" : "_doc", "_id" : "1" } } +POST _bulk?include_type_name=false +{ "index" : { "_index" : "test", "_id" : "1" } } { "field1" : "value1" } -{ "delete" : { "_index" : "test", "_type" : "_doc", "_id" : "2" } } -{ "create" : { "_index" : "test", "_type" : "_doc", "_id" : "3" } } +{ "delete" : { "_index" : "test", "_id" : "2" } } +{ "create" : { "_index" : "test", "_id" : "3" } } { "field1" : "value3" } -{ "update" : {"_id" : "1", "_type" : "_doc", "_index" : "test"} } +{ "update" : {"_id" : "1", "_index" : "test"} } { "doc" : {"field2" : "value2"} } -------------------------------------------------- // CONSOLE @@ -93,7 +93,6 @@ The result of this bulk operation is: { "index": { "_index": "test", - "_type": "_doc", "_id": "1", "_version": 1, "result": "created", @@ -110,7 +109,6 @@ The result of this bulk operation is: { "delete": { "_index": "test", - "_type": "_doc", "_id": "2", "_version": 1, "result": "not_found", @@ -127,7 +125,6 @@ The result of this bulk operation is: { "create": { "_index": "test", - "_type": "_doc", "_id": "3", "_version": 1, "result": "created", @@ -144,7 +141,6 @@ The result of this bulk operation is: { "update": { "_index": "test", - "_type": "_doc", "_id": "1", "_version": 2, "result": "updated", @@ -172,9 +168,9 @@ The result of this bulk operation is: // TESTRESPONSE[s/"_seq_no" : 3/"_seq_no" : $body.items.3.update._seq_no/] // TESTRESPONSE[s/"_primary_term" : 4/"_primary_term" : $body.items.3.update._primary_term/] -The endpoints are `/_bulk`, `/{index}/_bulk`, and `{index}/{type}/_bulk`. -When the index or the index/type are provided, they will be used by -default on bulk items that don't provide them explicitly. +The endpoints are `/_bulk` and `/{index}/_bulk`. +When the index is provided, it will be used by +default on bulk items that don't provide index names explicitly. A note on the format. The idea here is to make processing of this as fast as possible. As some of the actions will be redirected to other @@ -252,16 +248,16 @@ the options. Example with update actions: [source,js] -------------------------------------------------- -POST _bulk -{ "update" : {"_id" : "1", "_type" : "_doc", "_index" : "index1", "retry_on_conflict" : 3} } +POST _bulk?include_type_name=false +{ "update" : {"_id" : "1", "_index" : "index1", "retry_on_conflict" : 3} } { "doc" : {"field" : "value"} } -{ "update" : { "_id" : "0", "_type" : "_doc", "_index" : "index1", "retry_on_conflict" : 3} } +{ "update" : { "_id" : "0", "_index" : "index1", "retry_on_conflict" : 3} } { "script" : { "source": "ctx._source.counter += params.param1", "lang" : "painless", "params" : {"param1" : 1}}, "upsert" : {"counter" : 1}} -{ "update" : {"_id" : "2", "_type" : "_doc", "_index" : "index1", "retry_on_conflict" : 3} } +{ "update" : {"_id" : "2", "_index" : "index1", "retry_on_conflict" : 3} } { "doc" : {"field" : "value"}, "doc_as_upsert" : true } -{ "update" : {"_id" : "3", "_type" : "_doc", "_index" : "index1", "_source" : true} } +{ "update" : {"_id" : "3", "_index" : "index1", "_source" : true} } { "doc" : {"field" : "value"} } -{ "update" : {"_id" : "4", "_type" : "_doc", "_index" : "index1"} } +{ "update" : {"_id" : "4", "_index" : "index1"} } { "doc" : {"field" : "value"}, "_source": true} -------------------------------------------------- // CONSOLE diff --git a/docs/reference/docs/delete-by-query.asciidoc b/docs/reference/docs/delete-by-query.asciidoc index 6edc453903d66..aa770d5b49145 100644 --- a/docs/reference/docs/delete-by-query.asciidoc +++ b/docs/reference/docs/delete-by-query.asciidoc @@ -467,7 +467,7 @@ Which you can verify works with: [source,js] ---------------------------------------------------------------- GET _refresh -POST twitter/_search?size=0&filter_path=hits.total +POST twitter/_search?size=0&filter_path=hits.total&include_type_name=false { "query": { "range": { @@ -521,7 +521,7 @@ Which you also can verify works with: [source,js] ---------------------------------------------------------------- -POST twitter/_search?size=0&filter_path=hits.total +POST twitter/_search?size=0&filter_path=hits.total&include_type_name=false { "query": { "range": { diff --git a/docs/reference/docs/delete.asciidoc b/docs/reference/docs/delete.asciidoc index 49f31eb2d75fb..dc9397f56f0ed 100644 --- a/docs/reference/docs/delete.asciidoc +++ b/docs/reference/docs/delete.asciidoc @@ -7,7 +7,7 @@ from an index called `twitter`, under a type called `_doc`, with id `1`: [source,js] -------------------------------------------------- -DELETE /twitter/_doc/1 +DELETE /twitter/_doc/1?include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] @@ -23,7 +23,6 @@ The result of the above delete operation is: "successful" : 2 }, "_index" : "twitter", - "_type" : "_doc", "_id" : "1", "_version" : 2, "_primary_term": 1, @@ -72,7 +71,7 @@ PUT /twitter/_doc/1?routing=kimchy [source,js] -------------------------------------------------- -DELETE /twitter/_doc/1?routing=kimchy +DELETE /twitter/_doc/1?routing=kimchy&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] @@ -138,7 +137,7 @@ to 5 minutes: [source,js] -------------------------------------------------- -DELETE /twitter/_doc/1?timeout=5m +DELETE /twitter/_doc/1?timeout=5m&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] diff --git a/docs/reference/docs/get.asciidoc b/docs/reference/docs/get.asciidoc index 94ddf70309792..6c7a3200ff8cc 100644 --- a/docs/reference/docs/get.asciidoc +++ b/docs/reference/docs/get.asciidoc @@ -7,7 +7,7 @@ twitter, under a type called _doc, with id valued 0: [source,js] -------------------------------------------------- -GET twitter/_doc/0 +GET twitter/_doc/0?include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] @@ -18,7 +18,6 @@ The result of the above get operation is: -------------------------------------------------- { "_index" : "twitter", - "_type" : "_doc", "_id" : "0", "_version" : 1, "found": true, @@ -142,7 +141,7 @@ PUT twitter/_doc/1 [source,js] -------------------------------------------------- -GET twitter/_doc/1?stored_fields=tags,counter +GET twitter/_doc/1?stored_fields=tags,counter&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] @@ -153,7 +152,6 @@ The result of the above get operation is: -------------------------------------------------- { "_index": "twitter", - "_type": "_doc", "_id": "1", "_version": 1, "found": true, @@ -174,7 +172,7 @@ It is also possible to retrieve metadata fields like the `_routing` field: [source,js] -------------------------------------------------- -PUT twitter/_doc/2?routing=user1 +PUT twitter/_doc/2?routing=user1&include_type_name=false { "counter" : 1, "tags" : ["white"] @@ -185,7 +183,7 @@ PUT twitter/_doc/2?routing=user1 [source,js] -------------------------------------------------- -GET twitter/_doc/2?routing=user1&stored_fields=tags,counter +GET twitter/_doc/2?routing=user1&stored_fields=tags,counter&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] @@ -196,7 +194,6 @@ The result of the above get operation is: -------------------------------------------------- { "_index": "twitter", - "_type": "_doc", "_id": "2", "_version": 1, "_routing": "user1", @@ -256,7 +253,7 @@ a document, the routing value should also be provided. For example: [source,js] -------------------------------------------------- -GET twitter/_doc/2?routing=user1 +GET twitter/_doc/2?routing=user1&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] diff --git a/docs/reference/docs/index_.asciidoc b/docs/reference/docs/index_.asciidoc index 01eb0ad6adf90..a01e2f527e3ae 100644 --- a/docs/reference/docs/index_.asciidoc +++ b/docs/reference/docs/index_.asciidoc @@ -9,7 +9,7 @@ into the "twitter" index, under a type called "_doc" with an id of 1: [source,js] -------------------------------------------------- -PUT twitter/_doc/1 +PUT twitter/_doc/1?include_type_name=false { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", @@ -29,7 +29,6 @@ The result of the above index operation is: "successful" : 2 }, "_index" : "twitter", - "_type" : "_doc", "_id" : "1", "_version" : 1, "_seq_no" : 0, @@ -96,7 +95,7 @@ meantime. For example: [source,js] -------------------------------------------------- -PUT twitter/_doc/1?version=2 +PUT twitter/_doc/1?version=2&include_type_name=false { "message" : "elasticsearch now has versioning support, double cool!" } @@ -176,7 +175,7 @@ Here is an example of using the `op_type` parameter: [source,js] -------------------------------------------------- -PUT twitter/_doc/1?op_type=create +PUT twitter/_doc/1?op_type=create&include_type_name=false { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", @@ -208,7 +207,7 @@ will automatically be set to `create`. Here is an example (note the [source,js] -------------------------------------------------- -POST twitter/_doc/ +POST twitter/_doc?include_type_name=false { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", @@ -228,7 +227,6 @@ The result of the above index operation is: "successful" : 2 }, "_index" : "twitter", - "_type" : "_doc", "_id" : "W0tpsmIBdwcYyG50zbta", "_version" : 1, "_seq_no" : 0, @@ -249,7 +247,7 @@ on a per-operation basis using the `routing` parameter. For example: [source,js] -------------------------------------------------- -POST twitter/_doc?routing=kimchy +POST twitter/_doc?routing=kimchy&include_type_name=false { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", @@ -372,7 +370,7 @@ to 5 minutes: [source,js] -------------------------------------------------- -PUT twitter/_doc/1?timeout=5m +PUT twitter/_doc/1?timeout=5m&include_type_name=false { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", diff --git a/docs/reference/docs/reindex.asciidoc b/docs/reference/docs/reindex.asciidoc index e6a47e0a39823..46c41c8b41f4f 100644 --- a/docs/reference/docs/reindex.asciidoc +++ b/docs/reference/docs/reindex.asciidoc @@ -920,7 +920,7 @@ You can verify this works by: [source,js] ---------------------------------------------------------------- GET _refresh -POST new_twitter/_search?size=0&filter_path=hits.total +POST new_twitter/_search?size=0&filter_path=hits.total&include_type_name=false ---------------------------------------------------------------- // CONSOLE // TEST[continued] @@ -963,7 +963,7 @@ You can also this verify works by: [source,js] ---------------------------------------------------------------- -POST new_twitter/_search?size=0&filter_path=hits.total +POST new_twitter/_search?size=0&filter_path=hits.total&include_type_name=false ---------------------------------------------------------------- // CONSOLE // TEST[continued] diff --git a/docs/reference/docs/update-by-query.asciidoc b/docs/reference/docs/update-by-query.asciidoc index 6e7cfbd2b794b..fa143e346c82c 100644 --- a/docs/reference/docs/update-by-query.asciidoc +++ b/docs/reference/docs/update-by-query.asciidoc @@ -516,7 +516,7 @@ Which you can verify works with: [source,js] ---------------------------------------------------------------- GET _refresh -POST twitter/_search?size=0&q=extra:test&filter_path=hits.total +POST twitter/_search?size=0&q=extra:test&filter_path=hits.total&include_type_name=false ---------------------------------------------------------------- // CONSOLE // TEST[continued] @@ -557,7 +557,7 @@ Which you also can verify works with: [source,js] ---------------------------------------------------------------- -POST twitter/_search?size=0&q=extra:test&filter_path=hits.total +POST twitter/_search?size=0&q=extra:test&filter_path=hits.total&include_type_name=false ---------------------------------------------------------------- // CONSOLE // TEST[continued] @@ -673,7 +673,7 @@ Searching for the data won't find anything: [source,js] -------------------------------------------------- -POST test/_search?filter_path=hits.total +POST test/_search?filter_path=hits.total&include_type_name=false { "query": { "match": { @@ -700,7 +700,7 @@ But you can issue an `_update_by_query` request to pick up the new mapping: [source,js] -------------------------------------------------- POST test/_update_by_query?refresh&conflicts=proceed -POST test/_search?filter_path=hits.total +POST test/_search?filter_path=hits.total&include_type_name=false { "query": { "match": { diff --git a/docs/reference/docs/update.asciidoc b/docs/reference/docs/update.asciidoc index 1cfc122bee402..01cb5d88fe415 100644 --- a/docs/reference/docs/update.asciidoc +++ b/docs/reference/docs/update.asciidoc @@ -17,7 +17,7 @@ For example, let's index a simple doc: [source,js] -------------------------------------------------- -PUT test/_doc/1 +PUT test/_doc/1?include_type_name=false { "counter" : 1, "tags" : ["red"] @@ -32,7 +32,7 @@ Now, we can execute a script that would increment the counter: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : { "source": "ctx._source.counter += params.count", @@ -51,7 +51,7 @@ will still add it, since it's a list): [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : { "source": "ctx._source.tags.add(params.tag)", @@ -73,7 +73,7 @@ remove only one occurrence of it: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : { "source": "if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }", @@ -95,7 +95,7 @@ We can also add a new field to the document: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : "ctx._source.new_field = 'value_of_new_field'" } @@ -107,7 +107,7 @@ Or remove a field from the document: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : "ctx._source.remove('new_field')" } @@ -121,7 +121,7 @@ the doc if the `tags` field contain `green`, otherwise it does nothing [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : { "source": "if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'none' }", @@ -148,7 +148,7 @@ existing document: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "doc" : { "name" : "new_name" @@ -169,7 +169,7 @@ By default updates that don't change anything detect that they don't change anyt [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "doc" : { "name" : "new_name" @@ -192,7 +192,6 @@ the request was ignored. "failed": 0 }, "_index": "test", - "_type": "_doc", "_id": "1", "_version": 7, "result": "noop" @@ -204,7 +203,7 @@ You can disable this behavior by setting "detect_noop": false like this: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "doc" : { "name" : "new_name" @@ -225,7 +224,7 @@ will be inserted as a new document. If the document does exist, then the [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "script" : { "source": "ctx._source.counter += params.count", @@ -251,7 +250,7 @@ or not -- i.e. the script handles initializing the document instead of the [source,js] -------------------------------------------------- -POST sessions/session/dh3sgudg8gsrgl/_update +POST sessions/_doc/dh3sgudg8gsrgl/_update?include_type_name=false { "scripted_upsert":true, "script" : { @@ -280,7 +279,7 @@ value: [source,js] -------------------------------------------------- -POST test/_doc/1/_update +POST test/_doc/1/_update?include_type_name=false { "doc" : { "name" : "new_name" diff --git a/docs/reference/getting-started.asciidoc b/docs/reference/getting-started.asciidoc index 6e536f382ddfc..f171abcfde138 100755 --- a/docs/reference/getting-started.asciidoc +++ b/docs/reference/getting-started.asciidoc @@ -375,7 +375,7 @@ Now let's create an index named "customer" and then list all the indexes again: [source,js] -------------------------------------------------- -PUT /customer?pretty +PUT /customer?pretty&include_type_name=false GET /_cat/indices?v -------------------------------------------------- // CONSOLE @@ -401,7 +401,7 @@ Let's now put something into our customer index. We'll index a simple customer d [source,js] -------------------------------------------------- -PUT /customer/_doc/1?pretty +PUT /customer/_doc/1?pretty&include_type_name=false { "name": "John Doe" } @@ -414,7 +414,6 @@ And the response: -------------------------------------------------- { "_index" : "customer", - "_type" : "_doc", "_id" : "1", "_version" : 1, "result" : "created", @@ -437,7 +436,7 @@ Let's now retrieve that document that we just indexed: [source,js] -------------------------------------------------- -GET /customer/_doc/1?pretty +GET /customer/_doc/1?pretty&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] @@ -448,7 +447,6 @@ And the response: -------------------------------------------------- { "_index" : "customer", - "_type" : "_doc", "_id" : "1", "_version" : 1, "found" : true, @@ -485,12 +483,12 @@ Before we move on, let's take a closer look again at some of the API commands th [source,js] -------------------------------------------------- -PUT /customer -PUT /customer/_doc/1 +PUT /customer?include_type_name=false +PUT /customer/_doc/1?include_type_name=false { "name": "John Doe" } -GET /customer/_doc/1 +GET /customer/_doc/1?include_type_name=false DELETE /customer -------------------------------------------------- // CONSOLE @@ -516,7 +514,7 @@ We've previously seen how we can index a single document. Let's recall that comm [source,js] -------------------------------------------------- -PUT /customer/_doc/1?pretty +PUT /customer/_doc/1?pretty&include_type_name=false { "name": "John Doe" } @@ -527,7 +525,7 @@ Again, the above will index the specified document into the customer index, with [source,js] -------------------------------------------------- -PUT /customer/_doc/1?pretty +PUT /customer/_doc/1?pretty&include_type_name=false { "name": "Jane Doe" } @@ -539,7 +537,7 @@ The above changes the name of the document with the ID of 1 from "John Doe" to " [source,js] -------------------------------------------------- -PUT /customer/_doc/2?pretty +PUT /customer/_doc/2?pretty&include_type_name=false { "name": "Jane Doe" } @@ -555,7 +553,7 @@ This example shows how to index a document without an explicit ID: [source,js] -------------------------------------------------- -POST /customer/_doc?pretty +POST /customer/_doc?pretty&include_type_name=false { "name": "Jane Doe" } @@ -573,7 +571,7 @@ This example shows how to update our previous document (ID of 1) by changing the [source,js] -------------------------------------------------- -POST /customer/_doc/1/_update?pretty +POST /customer/_doc/1/_update?pretty&include_type_name=false { "doc": { "name": "Jane Doe" } } @@ -585,7 +583,7 @@ This example shows how to update our previous document (ID of 1) by changing the [source,js] -------------------------------------------------- -POST /customer/_doc/1/_update?pretty +POST /customer/_doc/1/_update?pretty&include_type_name=false { "doc": { "name": "Jane Doe", "age": 20 } } @@ -597,7 +595,7 @@ Updates can also be performed by using simple scripts. This example uses a scrip [source,js] -------------------------------------------------- -POST /customer/_doc/1/_update?pretty +POST /customer/_doc/1/_update?pretty&include_type_name=false { "script" : "ctx._source.age += 5" } @@ -615,7 +613,7 @@ Deleting a document is fairly straightforward. This example shows how to delete [source,js] -------------------------------------------------- -DELETE /customer/_doc/2?pretty +DELETE /customer/_doc/2?pretty&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] @@ -632,7 +630,7 @@ As a quick example, the following call indexes two documents (ID 1 - John Doe an [source,js] -------------------------------------------------- -POST /customer/_doc/_bulk?pretty +POST /customer/_bulk?pretty&include_type_name=false {"index":{"_id":"1"}} {"name": "John Doe" } {"index":{"_id":"2"}} @@ -644,7 +642,7 @@ This example updates the first document (ID of 1) and then deletes the second do [source,sh] -------------------------------------------------- -POST /customer/_doc/_bulk?pretty +POST /customer/_bulk?pretty&include_type_name=false {"update":{"_id":"1"}} {"doc": { "name": "John Doe becomes Jane Doe" } } {"delete":{"_id":"2"}} @@ -690,7 +688,7 @@ You can download the sample dataset (accounts.json) from https://github.com/elas [source,sh] -------------------------------------------------- -curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_doc/_bulk?pretty&refresh" --data-binary "@accounts.json" +curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_bulk?pretty&refresh&include_type_name=false" --data-binary "@accounts.json" curl "localhost:9200/_cat/indices?v" -------------------------------------------------- // NOTCONSOLE @@ -727,7 +725,7 @@ The REST API for search is accessible from the `_search` endpoint. This example [source,js] -------------------------------------------------- -GET /bank/_search?q=*&sort=account_number:asc&pretty +GET /bank/_search?q=*&sort=account_number:asc&pretty&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] @@ -752,14 +750,12 @@ And the response (partially shown): "max_score" : null, "hits" : [ { "_index" : "bank", - "_type" : "_doc", "_id" : "0", "sort": [0], "_score" : null, "_source" : {"account_number":0,"balance":16623,"firstname":"Bradshaw","lastname":"Mckenzie","age":29,"gender":"F","address":"244 Columbus Place","employer":"Euron","email":"bradshawmckenzie@euron.com","city":"Hobucken","state":"CO"} }, { "_index" : "bank", - "_type" : "_doc", "_id" : "1", "sort": [1], "_score" : null, @@ -787,7 +783,7 @@ Here is the same exact search above using the alternative request body method: [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_all": {} }, "sort": [ @@ -820,14 +816,12 @@ to clutter the docs with it: "max_score": null, "hits" : [ { "_index" : "bank", - "_type" : "_doc", "_id" : "0", "sort": [0], "_score": null, "_source" : {"account_number":0,"balance":16623,"firstname":"Bradshaw","lastname":"Mckenzie","age":29,"gender":"F","address":"244 Columbus Place","employer":"Euron","email":"bradshawmckenzie@euron.com","city":"Hobucken","state":"CO"} }, { "_index" : "bank", - "_type" : "_doc", "_id" : "1", "sort": [1], "_score": null, @@ -852,7 +846,7 @@ Going back to our last example, we executed this query: [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_all": {} } } @@ -868,7 +862,7 @@ influence the search results. In the example in the section above we passed in [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_all": {} }, "size": 1 @@ -883,7 +877,7 @@ This example does a `match_all` and returns documents 10 through 19: [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_all": {} }, "from": 10, @@ -899,7 +893,7 @@ This example does a `match_all` and sorts the results by account balance in desc [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_all": {} }, "sort": { "balance": { "order": "desc" } } @@ -916,7 +910,7 @@ This example shows how to return two fields, `account_number` and `balance` (ins [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_all": {} }, "_source": ["account_number", "balance"] @@ -935,7 +929,7 @@ This example returns the account numbered 20: [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match": { "account_number": 20 } } } @@ -947,7 +941,7 @@ This example returns all accounts containing the term "mill" in the address: [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match": { "address": "mill" } } } @@ -959,7 +953,7 @@ This example returns all accounts containing the term "mill" or "lane" in the ad [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match": { "address": "mill lane" } } } @@ -971,7 +965,7 @@ This example is a variant of `match` (`match_phrase`) that returns all accounts [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "match_phrase": { "address": "mill lane" } } } @@ -985,7 +979,7 @@ This example composes two `match` queries and returns all accounts containing "m [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "bool": { @@ -1006,7 +1000,7 @@ In contrast, this example composes two `match` queries and returns all accounts [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "bool": { @@ -1027,7 +1021,7 @@ This example composes two `match` queries and returns all accounts that contain [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "bool": { @@ -1050,7 +1044,7 @@ This example returns all accounts of anybody who is 40 years old but doesn't liv [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "bool": { @@ -1079,7 +1073,7 @@ This example uses a bool query to return all accounts with balances between 2000 [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "query": { "bool": { @@ -1111,7 +1105,7 @@ To start with, this example groups all the accounts by state, and then returns t [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "size": 0, "aggs": { @@ -1201,7 +1195,7 @@ Building on the previous aggregation, this example calculates the average accoun [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "size": 0, "aggs": { @@ -1229,7 +1223,7 @@ Building on the previous aggregation, let's now sort on the average balance in d [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "size": 0, "aggs": { @@ -1258,7 +1252,7 @@ This example demonstrates how we can group by age brackets (ages 20-29, 30-39, a [source,js] -------------------------------------------------- -GET /bank/_search +GET /bank/_search?include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/how-to/recipes/stemming.asciidoc b/docs/reference/how-to/recipes/stemming.asciidoc index c09922fe63fc3..e71a1a4ef3278 100644 --- a/docs/reference/how-to/recipes/stemming.asciidoc +++ b/docs/reference/how-to/recipes/stemming.asciidoc @@ -9,7 +9,7 @@ content indexed in two different ways: [source,js] -------------------------------------------------- -PUT index +PUT index?include_type_name=false { "settings": { "analysis": { @@ -24,16 +24,14 @@ PUT index } }, "mappings": { - "_doc": { - "properties": { - "body": { - "type": "text", - "analyzer": "english", - "fields": { - "exact": { - "type": "text", - "analyzer": "english_exact" - } + "properties": { + "body": { + "type": "text", + "analyzer": "english", + "fields": { + "exact": { + "type": "text", + "analyzer": "english_exact" } } } @@ -41,12 +39,12 @@ PUT index } } -PUT index/_doc/1 +PUT index/_doc/1?include_type_name=false { "body": "Ski resort" } -PUT index/_doc/2 +PUT index/_doc/2?include_type_name=false { "body": "A pair of skis" } @@ -59,7 +57,7 @@ With such a setup, searching for `ski` on `body` would return both documents: [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "query": { "simple_query_string": { @@ -89,7 +87,6 @@ GET index/_search "hits": [ { "_index": "index", - "_type": "_doc", "_id": "1", "_score": 0.18232156, "_source": { @@ -98,7 +95,6 @@ GET index/_search }, { "_index": "index", - "_type": "_doc", "_id": "2", "_score": 0.18232156, "_source": { @@ -117,7 +113,7 @@ stemming. [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "query": { "simple_query_string": { @@ -147,7 +143,6 @@ GET index/_search "hits": [ { "_index": "index", - "_type": "_doc", "_id": "1", "_score": 0.8025915, "_source": { @@ -173,7 +168,7 @@ field, see below: [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "query": { "simple_query_string": { @@ -204,7 +199,6 @@ GET index/_search "hits": [ { "_index": "index", - "_type": "_doc", "_id": "1", "_score": 0.8025915, "_source": { diff --git a/docs/reference/how-to/search-speed.asciidoc b/docs/reference/how-to/search-speed.asciidoc index bb5b0edd2e6bb..5385890afed56 100644 --- a/docs/reference/how-to/search-speed.asciidoc +++ b/docs/reference/how-to/search-speed.asciidoc @@ -50,22 +50,20 @@ field. [source,js] -------------------------------------------------- -PUT movies +PUT movies?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "name_and_plot": { - "type": "text" - }, - "name": { - "type": "text", - "copy_to": "name_and_plot" - }, - "plot": { - "type": "text", - "copy_to": "name_and_plot" - } + "properties": { + "name_and_plot": { + "type": "text" + }, + "name": { + "type": "text", + "copy_to": "name_and_plot" + }, + "plot": { + "type": "text", + "copy_to": "name_and_plot" } } } @@ -87,7 +85,7 @@ For instance, if documents look like: [source,js] -------------------------------------------------- -PUT index/_doc/1 +PUT index/_doc/1?include_type_name=false { "designation": "spoon", "price": 13 @@ -99,7 +97,7 @@ and search requests look like: [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "aggs": { "price_ranges": { @@ -123,20 +121,18 @@ should be mapped as a <>: [source,js] -------------------------------------------------- -PUT index +PUT index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "price_range": { - "type": "keyword" - } + "properties": { + "price_range": { + "type": "keyword" } } } } -PUT index/_doc/1 +PUT index/_doc/1?include_type_name=false { "designation": "spoon", "price": 13, @@ -150,7 +146,7 @@ And then search requests could aggregate this new field rather than running a [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "aggs": { "price_ranges": { @@ -193,12 +189,12 @@ For instance the below query: [source,js] -------------------------------------------------- -PUT index/_doc/1 +PUT index/_doc/1?include_type_name=false { "my_date": "2016-05-11T16:30:55.328Z" } -GET index/_search +GET index/_search?include_type_name=false { "query": { "constant_score": { @@ -220,7 +216,7 @@ could be replaced with the following query: [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "query": { "constant_score": { @@ -254,7 +250,7 @@ as shown below: [source,js] -------------------------------------------------- -GET index/_search +GET index/_search?include_type_name=false { "query": { "constant_score": { @@ -322,15 +318,13 @@ eagerly at refresh-time by configuring mappings as described below: [source,js] -------------------------------------------------- -PUT index +PUT index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "foo": { - "type": "keyword", - "eager_global_ordinals": true - } + "properties": { + "foo": { + "type": "keyword", + "eager_global_ordinals": true } } } diff --git a/docs/reference/index-modules/index-sorting.asciidoc b/docs/reference/index-modules/index-sorting.asciidoc index 9d1dfcb1a75f2..85f73b7adaeab 100644 --- a/docs/reference/index-modules/index-sorting.asciidoc +++ b/docs/reference/index-modules/index-sorting.asciidoc @@ -147,7 +147,7 @@ You can search for the last 10 events with: [source,js] -------------------------------------------------- -GET /events/_search +GET /events/_search?include_type_name=false { "size": 10, "sort": [ @@ -169,7 +169,7 @@ to false: [source,js] -------------------------------------------------- -GET /events/_search +GET /events/_search?include_type_name=false { "size": 10, "sort": [ <1> diff --git a/docs/reference/index-modules/similarity.asciidoc b/docs/reference/index-modules/similarity.asciidoc index cf5cab106f891..3f52f97b125ac 100644 --- a/docs/reference/index-modules/similarity.asciidoc +++ b/docs/reference/index-modules/similarity.asciidoc @@ -20,7 +20,7 @@ settings. [source,js] -------------------------------------------------- -PUT /index +PUT /index?include_type_name=false { "settings" : { "index" : { @@ -200,7 +200,7 @@ TF-IDF: [source,js] -------------------------------------------------- -PUT /index +PUT /index?include_type_name=false { "settings": { "number_of_shards": 1, @@ -214,30 +214,28 @@ PUT /index } }, "mappings": { - "_doc": { - "properties": { - "field": { - "type": "text", - "similarity": "scripted_tfidf" - } + "properties": { + "field": { + "type": "text", + "similarity": "scripted_tfidf" } } } } -PUT /index/_doc/1 +PUT /index/_doc/1?include_type_name=false { "field": "foo bar foo" } -PUT /index/_doc/2 +PUT /index/_doc/2?include_type_name=false { "field": "bar baz" } POST /index/_refresh -GET /index/_search?explain=true +GET /index/_search?explain=true&include_type_name=false { "query": { "query_string": { @@ -270,7 +268,6 @@ Which yields: "_shard": "[index][0]", "_node": "OzrdjxNtQGaqs4DmioFw9A", "_index": "index", - "_type": "_doc", "_id": "1", "_score": 1.9508477, "_source": { @@ -366,7 +363,7 @@ more efficient: [source,js] -------------------------------------------------- -PUT /index +PUT /index?include_type_name=false { "settings": { "number_of_shards": 1, @@ -383,12 +380,10 @@ PUT /index } }, "mappings": { - "_doc": { - "properties": { - "field": { - "type": "text", - "similarity": "scripted_tfidf" - } + "properties": { + "field": { + "type": "text", + "similarity": "scripted_tfidf" } } } @@ -400,19 +395,19 @@ PUT /index [source,js] -------------------------------------------------- -PUT /index/_doc/1 +PUT /index/_doc/1?include_type_name=false { "field": "foo bar foo" } -PUT /index/_doc/2 +PUT /index/_doc/2?include_type_name=false { "field": "bar baz" } POST /index/_refresh -GET /index/_search?explain=true +GET /index/_search?explain=true&include_type_name=false { "query": { "query_string": { @@ -444,7 +439,6 @@ GET /index/_search?explain=true "_shard": "[index][0]", "_node": "OzrdjxNtQGaqs4DmioFw9A", "_index": "index", - "_type": "_doc", "_id": "1", "_score": 1.9508477, "_source": { @@ -531,7 +525,7 @@ it is <>: [source,js] -------------------------------------------------- -PUT /index +PUT /index?include_type_name=false { "settings": { "index": { diff --git a/docs/reference/indices/create-index.asciidoc b/docs/reference/indices/create-index.asciidoc index b013c747a3229..2160d5104b8f3 100644 --- a/docs/reference/indices/create-index.asciidoc +++ b/docs/reference/indices/create-index.asciidoc @@ -37,7 +37,7 @@ associated with it, defined in the body: [source,js] -------------------------------------------------- -PUT twitter +PUT twitter?include_type_name=false { "settings" : { "index" : { @@ -55,7 +55,7 @@ or more simplified [source,js] -------------------------------------------------- -PUT twitter +PUT twitter?include_type_name=false { "settings" : { "number_of_shards" : 3, @@ -82,16 +82,14 @@ The create index API allows to provide a type mapping: [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "settings" : { "number_of_shards" : 1 }, "mappings" : { - "type1" : { - "properties" : { - "field1" : { "type" : "text" } - } + "properties" : { + "field1" : { "type" : "text" } } } } @@ -106,7 +104,7 @@ The create index API allows also to provide a set of <> [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "aliases" : { "alias_1" : {}, @@ -156,7 +154,7 @@ the `wait_for_active_shards` value on all subsequent write operations): [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "settings": { "index.write.wait_for_active_shards": "2" @@ -170,7 +168,7 @@ or through the request parameter `wait_for_active_shards`: [source,js] -------------------------------------------------- -PUT test?wait_for_active_shards=2 +PUT test?wait_for_active_shards=2&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[skip:requires two nodes] diff --git a/docs/reference/indices/rollover-index.asciidoc b/docs/reference/indices/rollover-index.asciidoc index 1730c95e0dd24..ecac8b03c26f3 100644 --- a/docs/reference/indices/rollover-index.asciidoc +++ b/docs/reference/indices/rollover-index.asciidoc @@ -168,8 +168,8 @@ over indices created in the last three days, you could do the following: [source,js] -------------------------------------------------- -# GET /,,/_search -GET /%3Clogs-%7Bnow%2Fd%7D-*%3E%2C%3Clogs-%7Bnow%2Fd-1d%7D-*%3E%2C%3Clogs-%7Bnow%2Fd-2d%7D-*%3E/_search +# GET /,,/_search?include_type_name=false +GET /%3Clogs-%7Bnow%2Fd%7D-*%3E%2C%3Clogs-%7Bnow%2Fd-1d%7D-*%3E%2C%3Clogs-%7Bnow%2Fd-2d%7D-*%3E/_search?include_type_name=false -------------------------------------------------- // CONSOLE // TEST[continued] diff --git a/docs/reference/mapping/fields/id-field.asciidoc b/docs/reference/mapping/fields/id-field.asciidoc index 0f4ed15196962..f66f1bf355f87 100644 --- a/docs/reference/mapping/fields/id-field.asciidoc +++ b/docs/reference/mapping/fields/id-field.asciidoc @@ -21,7 +21,7 @@ PUT my_index/_doc/2&refresh=true "text": "Document with ID 2" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "terms": { diff --git a/docs/reference/mapping/fields/ignored-field.asciidoc b/docs/reference/mapping/fields/ignored-field.asciidoc index d2776ea86b26b..75ace530013df 100644 --- a/docs/reference/mapping/fields/ignored-field.asciidoc +++ b/docs/reference/mapping/fields/ignored-field.asciidoc @@ -16,7 +16,7 @@ that got ignored: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "exists": { @@ -32,7 +32,7 @@ ignored at index time: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "term": { diff --git a/docs/reference/mapping/fields/index-field.asciidoc b/docs/reference/mapping/fields/index-field.asciidoc index b11c1cee14403..5aaa828b3abb0 100644 --- a/docs/reference/mapping/fields/index-field.asciidoc +++ b/docs/reference/mapping/fields/index-field.asciidoc @@ -26,7 +26,7 @@ PUT index_2/_doc/2?refresh=true "text": "Document in index 2" } -GET index_1,index_2/_search +GET index_1,index_2/_search?include_type_name=false { "query": { "terms": { diff --git a/docs/reference/mapping/fields/routing-field.asciidoc b/docs/reference/mapping/fields/routing-field.asciidoc index 07fbb80bcb664..f7bef7fa3a47a 100644 --- a/docs/reference/mapping/fields/routing-field.asciidoc +++ b/docs/reference/mapping/fields/routing-field.asciidoc @@ -13,7 +13,7 @@ value per document. For instance: [source,js] ------------------------------ -PUT my_index/_doc/1?routing=user1&refresh=true <1> +PUT my_index/_doc/1?routing=user1&refresh=true&include_type_name=false <1> { "title": "This is a document" } @@ -32,7 +32,7 @@ The value of the `_routing` field is accessible in queries: [source,js] -------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "terms": { @@ -53,7 +53,7 @@ just the shard that matches the specific routing value (or values): [source,js] ------------------------------ -GET my_index/_search?routing=user1,user2 <1> +GET my_index/_search?routing=user1,user2&include_type_name=false <1> { "query": { "match": { @@ -79,7 +79,7 @@ custom `routing` value required for all CRUD operations: [source,js] ------------------------------ -PUT my_index2 +PUT my_index2?include_type_name=false { "mappings": { "_doc": { @@ -90,7 +90,7 @@ PUT my_index2 } } -PUT my_index2/_doc/1 <2> +PUT my_index2/_doc/1?include_type_name=false <2> { "text": "No routing value provided" } @@ -133,4 +133,4 @@ less than `index.number_of_shards`. Once enabled, the partitioned index will have the following limitations: * Mappings with <> relationships cannot be created within it. -* All mappings within the index must have the `_routing` field marked as required. \ No newline at end of file +* All mappings within the index must have the `_routing` field marked as required. diff --git a/docs/reference/mapping/fields/source-field.asciidoc b/docs/reference/mapping/fields/source-field.asciidoc index e872d31e56326..bd7c376859cf7 100644 --- a/docs/reference/mapping/fields/source-field.asciidoc +++ b/docs/reference/mapping/fields/source-field.asciidoc @@ -119,7 +119,7 @@ PUT logs/_doc/1 } } -GET logs/_search +GET logs/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/fields/type-field.asciidoc b/docs/reference/mapping/fields/type-field.asciidoc index c1cfa7971025f..24fafb5ae525d 100644 --- a/docs/reference/mapping/fields/type-field.asciidoc +++ b/docs/reference/mapping/fields/type-field.asciidoc @@ -19,7 +19,7 @@ PUT my_index/_doc/1?refresh=true "text": "Document with type 'doc'" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { diff --git a/docs/reference/mapping/params/analyzer.asciidoc b/docs/reference/mapping/params/analyzer.asciidoc index c885b99ab6313..27926a5387b3d 100644 --- a/docs/reference/mapping/params/analyzer.asciidoc +++ b/docs/reference/mapping/params/analyzer.asciidoc @@ -146,7 +146,7 @@ PUT my_index/_doc/2 "title":"A Quick Brown Fox" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query":{ "query_string":{ diff --git a/docs/reference/mapping/params/boost.asciidoc b/docs/reference/mapping/params/boost.asciidoc index f2a5e48483c70..1919d34e14a7d 100644 --- a/docs/reference/mapping/params/boost.asciidoc +++ b/docs/reference/mapping/params/boost.asciidoc @@ -34,7 +34,7 @@ You can achieve the same effect by using the boost parameter directly in the que [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "query": { "match" : { @@ -51,7 +51,7 @@ is equivalent to: [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "query": { "match" : { diff --git a/docs/reference/mapping/params/copy-to.asciidoc b/docs/reference/mapping/params/copy-to.asciidoc index 447d7baf274f4..72932dd9cdb0c 100644 --- a/docs/reference/mapping/params/copy-to.asciidoc +++ b/docs/reference/mapping/params/copy-to.asciidoc @@ -35,7 +35,7 @@ PUT my_index/_doc/1 "last_name": "Smith" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/params/ignore-above.asciidoc b/docs/reference/mapping/params/ignore-above.asciidoc index fe7c6881a064f..2ba499ee48886 100644 --- a/docs/reference/mapping/params/ignore-above.asciidoc +++ b/docs/reference/mapping/params/ignore-above.asciidoc @@ -8,31 +8,29 @@ NOTE: All strings/array elements will still be present in the `_source` field, i [source,js] -------------------------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "message": { - "type": "keyword", - "ignore_above": 20 <1> - } + "properties": { + "message": { + "type": "keyword", + "ignore_above": 20 <1> } } } } -PUT my_index/_doc/1 <2> +PUT my_index/_doc/1?include_type_name=false <2> { "message": "Syntax error" } -PUT my_index/_doc/2 <3> +PUT my_index/_doc/2?include_type_name=false <3> { "message": "Syntax error with some long stacktrace" } -GET _search <4> +GET _search?include_type_name=false <4> { "aggs": { "messages": { diff --git a/docs/reference/mapping/params/index-options.asciidoc b/docs/reference/mapping/params/index-options.asciidoc index 9bbdd017e0249..8b2bf7e77266c 100644 --- a/docs/reference/mapping/params/index-options.asciidoc +++ b/docs/reference/mapping/params/index-options.asciidoc @@ -54,7 +54,7 @@ PUT my_index/_doc/1 "text": "Quick brown fox" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/params/multi-fields.asciidoc b/docs/reference/mapping/params/multi-fields.asciidoc index 1489304bbaa60..6b5f92374213c 100644 --- a/docs/reference/mapping/params/multi-fields.asciidoc +++ b/docs/reference/mapping/params/multi-fields.asciidoc @@ -36,7 +36,7 @@ PUT my_index/_doc/2 "city": "York" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { @@ -101,7 +101,7 @@ PUT my_index/_doc/1 PUT my_index/_doc/2 { "text": "quick brown foxes" } <3> -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "multi_match": { diff --git a/docs/reference/mapping/params/normalizer.asciidoc b/docs/reference/mapping/params/normalizer.asciidoc index 73110cd11f5af..1853c8bf116d3 100644 --- a/docs/reference/mapping/params/normalizer.asciidoc +++ b/docs/reference/mapping/params/normalizer.asciidoc @@ -12,7 +12,7 @@ such as the <> query. [source,js] -------------------------------- -PUT index +PUT index?include_type_name=false { "settings": { "analysis": { @@ -26,35 +26,33 @@ PUT index } }, "mappings": { - "_doc": { - "properties": { - "foo": { - "type": "keyword", - "normalizer": "my_normalizer" - } + "properties": { + "foo": { + "type": "keyword", + "normalizer": "my_normalizer" } } } } -PUT index/_doc/1 +PUT index/_doc/1?include_type_name=false { "foo": "BÀR" } -PUT index/_doc/2 +PUT index/_doc/2?include_type_name=false { "foo": "bar" } -PUT index/_doc/3 +PUT index/_doc/3?include_type_name=false { "foo": "baz" } POST index/_refresh -GET index/_search +GET index/_search?include_type_name=false { "query": { "term": { @@ -63,7 +61,7 @@ GET index/_search } } -GET index/_search +GET index/_search?include_type_name=false { "query": { "match": { @@ -94,7 +92,6 @@ both index and query time. "hits": [ { "_index": "index", - "_type": "_doc", "_id": "1", "_score": 0.47000363, "_source": { @@ -103,7 +100,6 @@ both index and query time. }, { "_index": "index", - "_type": "_doc", "_id": "2", "_score": 0.47000363, "_source": { @@ -121,7 +117,7 @@ aggregations return normalized values: [source,js] ---------------------------- -GET index/_search +GET index/_search?include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/mapping/params/null-value.asciidoc b/docs/reference/mapping/params/null-value.asciidoc index f85724e66d0ae..cffa1a2e93e16 100644 --- a/docs/reference/mapping/params/null-value.asciidoc +++ b/docs/reference/mapping/params/null-value.asciidoc @@ -34,7 +34,7 @@ PUT my_index/_doc/2 "status_code": [] <2> } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { diff --git a/docs/reference/mapping/params/position-increment-gap.asciidoc b/docs/reference/mapping/params/position-increment-gap.asciidoc index c002d5a861aa8..803f6e9824db5 100644 --- a/docs/reference/mapping/params/position-increment-gap.asciidoc +++ b/docs/reference/mapping/params/position-increment-gap.asciidoc @@ -18,7 +18,7 @@ PUT my_index/_doc/1 "names": [ "John Abraham", "Lincoln Smith"] } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match_phrase": { @@ -29,7 +29,7 @@ GET my_index/_search } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match_phrase": { @@ -70,7 +70,7 @@ PUT my_index/_doc/1 "names": [ "John Abraham", "Lincoln Smith"] } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match_phrase": { diff --git a/docs/reference/mapping/params/properties.asciidoc b/docs/reference/mapping/params/properties.asciidoc index e50c0b3ac777f..66d24d0d91580 100644 --- a/docs/reference/mapping/params/properties.asciidoc +++ b/docs/reference/mapping/params/properties.asciidoc @@ -74,7 +74,7 @@ notation_: [source,js] -------------------------------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/params/search-analyzer.asciidoc b/docs/reference/mapping/params/search-analyzer.asciidoc index 1a67dfab63182..83153358b226c 100644 --- a/docs/reference/mapping/params/search-analyzer.asciidoc +++ b/docs/reference/mapping/params/search-analyzer.asciidoc @@ -55,7 +55,7 @@ PUT my_index/_doc/1 "text": "Quick Brown Fox" <3> } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/params/store.asciidoc b/docs/reference/mapping/params/store.asciidoc index 56c62385b59c8..9f8e481e5c3f9 100644 --- a/docs/reference/mapping/params/store.asciidoc +++ b/docs/reference/mapping/params/store.asciidoc @@ -46,7 +46,7 @@ PUT my_index/_doc/1 "content": "A very long content field..." } -GET my_index/_search +GET my_index/_search?include_type_name=false { "stored_fields": [ "title", "date" ] <2> } diff --git a/docs/reference/mapping/params/term-vector.asciidoc b/docs/reference/mapping/params/term-vector.asciidoc index c71c23f8a4881..d0c276d103286 100644 --- a/docs/reference/mapping/params/term-vector.asciidoc +++ b/docs/reference/mapping/params/term-vector.asciidoc @@ -48,7 +48,7 @@ PUT my_index/_doc/1 "text": "Quick brown fox" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/removal_of_types.asciidoc b/docs/reference/mapping/removal_of_types.asciidoc index 95881ba83856f..a83bec2a2b540 100644 --- a/docs/reference/mapping/removal_of_types.asciidoc +++ b/docs/reference/mapping/removal_of_types.asciidoc @@ -25,7 +25,7 @@ URL: [source,js] ---- -GET twitter/user,tweet/_search +GET twitter/user,tweet/_search?include_type_name=false { "query": { "match": { @@ -146,7 +146,7 @@ PUT twitter/tweet/1 "content": "Types are going away" } -GET twitter/tweet/_search +GET twitter/tweet/_search?include_type_name=false { "query": { "match": { @@ -193,7 +193,7 @@ PUT twitter/_doc/tweet-1 "content": "Types are going away" } -GET twitter/_search +GET twitter/_search?include_type_name=false { "query": { "bool": { diff --git a/docs/reference/mapping/types/alias.asciidoc b/docs/reference/mapping/types/alias.asciidoc index b4243d80e6d08..e7bfc54dbbca6 100644 --- a/docs/reference/mapping/types/alias.asciidoc +++ b/docs/reference/mapping/types/alias.asciidoc @@ -27,7 +27,7 @@ PUT trips } } -GET _search +GET _search?include_type_name=false { "query": { "range" : { @@ -81,7 +81,7 @@ source filtering. For example, the following request will return an empty result [source,js] -------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match_all": {} diff --git a/docs/reference/mapping/types/array.asciidoc b/docs/reference/mapping/types/array.asciidoc index 385c61ebcd753..251dd544c385a 100644 --- a/docs/reference/mapping/types/array.asciidoc +++ b/docs/reference/mapping/types/array.asciidoc @@ -66,7 +66,7 @@ PUT my_index/_doc/2 <3> } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/mapping/types/boolean.asciidoc b/docs/reference/mapping/types/boolean.asciidoc index 4ae350412bece..430e68a9ccf40 100644 --- a/docs/reference/mapping/types/boolean.asciidoc +++ b/docs/reference/mapping/types/boolean.asciidoc @@ -35,7 +35,7 @@ POST my_index/_doc/1 "is_published": "true" <1> } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -65,7 +65,7 @@ POST my_index/_doc/2 "is_published": false } -GET my_index/_search +GET my_index/_search?include_type_name=false { "aggs": { "publish_state": { diff --git a/docs/reference/mapping/types/date.asciidoc b/docs/reference/mapping/types/date.asciidoc index 1beb64083b8c8..cb7ae3ad01454 100644 --- a/docs/reference/mapping/types/date.asciidoc +++ b/docs/reference/mapping/types/date.asciidoc @@ -52,7 +52,7 @@ PUT my_index/_doc/2 PUT my_index/_doc/3 { "date": 1420070400001 } <4> -GET my_index/_search +GET my_index/_search?include_type_name=false { "sort": { "date": "asc"} <5> } diff --git a/docs/reference/mapping/types/feature-vector.asciidoc b/docs/reference/mapping/types/feature-vector.asciidoc index 2ce3c017fe3e5..db82b9f7665e8 100644 --- a/docs/reference/mapping/types/feature-vector.asciidoc +++ b/docs/reference/mapping/types/feature-vector.asciidoc @@ -40,7 +40,7 @@ PUT my_index/_doc/2 } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "feature": { diff --git a/docs/reference/mapping/types/feature.asciidoc b/docs/reference/mapping/types/feature.asciidoc index 3b5e78d5fb46b..204fee52271d1 100644 --- a/docs/reference/mapping/types/feature.asciidoc +++ b/docs/reference/mapping/types/feature.asciidoc @@ -29,7 +29,7 @@ PUT my_index/_doc/1 "url_length": 22 } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "feature": { diff --git a/docs/reference/mapping/types/geo-point.asciidoc b/docs/reference/mapping/types/geo-point.asciidoc index 97f2ddb52825b..e9767d83e6442 100644 --- a/docs/reference/mapping/types/geo-point.asciidoc +++ b/docs/reference/mapping/types/geo-point.asciidoc @@ -55,7 +55,7 @@ PUT my_index/_doc/4 "location": [ -71.34, 41.12 ] <4> } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "geo_bounding_box": { <5> diff --git a/docs/reference/mapping/types/ip.asciidoc b/docs/reference/mapping/types/ip.asciidoc index 695cd1c626bc3..20a328626c719 100644 --- a/docs/reference/mapping/types/ip.asciidoc +++ b/docs/reference/mapping/types/ip.asciidoc @@ -24,7 +24,7 @@ PUT my_index/_doc/1 "ip_addr": "192.168.1.1" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -79,7 +79,7 @@ notation: `[ip_address]/[prefix_length]`. For instance: [source,js] -------------------------------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -94,7 +94,7 @@ or [source,js] -------------------------------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -112,7 +112,7 @@ searched value: [source,js] -------------------------------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "query_string" : { diff --git a/docs/reference/mapping/types/nested.asciidoc b/docs/reference/mapping/types/nested.asciidoc index 238e26bf3375b..93f97e3b88af9 100644 --- a/docs/reference/mapping/types/nested.asciidoc +++ b/docs/reference/mapping/types/nested.asciidoc @@ -50,7 +50,7 @@ incorrectly match a query for `alice AND smith`: [source,js] -------------------------------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "bool": { @@ -103,7 +103,7 @@ PUT my_index/_doc/1 ] } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "nested": { @@ -120,7 +120,7 @@ GET my_index/_search } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "nested": { diff --git a/docs/reference/mapping/types/parent-join.asciidoc b/docs/reference/mapping/types/parent-join.asciidoc index 055109a4ce2d7..e25f24ce359e3 100644 --- a/docs/reference/mapping/types/parent-join.asciidoc +++ b/docs/reference/mapping/types/parent-join.asciidoc @@ -9,16 +9,14 @@ A parent/child relation can be defined as follows: [source,js] -------------------------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "my_join_field": { <1> - "type": "join", - "relations": { - "question": "answer" <2> - } + "properties": { + "my_join_field": { <1> + "type": "join", + "relations": { + "question": "answer" <2> } } } @@ -36,7 +34,7 @@ For instance the following example creates two `parent` documents in the `questi [source,js] -------------------------------------------------- -PUT my_index/_doc/1?refresh +PUT my_index/_doc/1?refresh&include_type_name=false { "text": "This is a question", "my_join_field": { @@ -44,7 +42,7 @@ PUT my_index/_doc/1?refresh } } -PUT my_index/_doc/2?refresh +PUT my_index/_doc/2?refresh&include_type_name=false { "text": "This is a another question", "my_join_field": { @@ -62,13 +60,13 @@ as a shortcut instead of encapsulating it in the normal object notation: [source,js] -------------------------------------------------- -PUT my_index/_doc/1?refresh +PUT my_index/_doc/1?refresh&include_type_name=false { "text": "This is a question", "my_join_field": "question" <1> } -PUT my_index/_doc/2?refresh +PUT my_index/_doc/2?refresh&include_type_name=false { "text": "This is another question", "my_join_field": "question" @@ -89,7 +87,7 @@ For instance the following example shows how to index two `child` documents: [source,js] -------------------------------------------------- -PUT my_index/_doc/3?routing=1&refresh <1> +PUT my_index/_doc/3?routing=1&refresh&include_type_name=false <1> { "text": "This is an answer", "my_join_field": { @@ -98,7 +96,7 @@ PUT my_index/_doc/3?routing=1&refresh <1> } } -PUT my_index/_doc/4?routing=1&refresh +PUT my_index/_doc/4?routing=1&refresh&include_type_name=false { "text": "This is another answer", "my_join_field": { @@ -157,7 +155,7 @@ returned in the search response: [source,js] -------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match_all": {} @@ -180,7 +178,6 @@ Will return: "hits": [ { "_index": "my_index", - "_type": "_doc", "_id": "1", "_score": null, "_source": { @@ -193,7 +190,6 @@ Will return: }, { "_index": "my_index", - "_type": "_doc", "_id": "2", "_score": null, "_source": { @@ -206,7 +202,6 @@ Will return: }, { "_index": "my_index", - "_type": "_doc", "_id": "3", "_score": null, "_routing": "1", @@ -223,7 +218,6 @@ Will return: }, { "_index": "my_index", - "_type": "_doc", "_id": "4", "_score": null, "_routing": "1", @@ -262,7 +256,7 @@ and scripts, and may be queried with the [source,js] -------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "parent_id": { <1> @@ -316,18 +310,16 @@ make sense to disable eager loading: [source,js] -------------------------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "my_join_field": { - "type": "join", - "relations": { - "question": "answer" - }, - "eager_global_ordinals": false - } + "properties": { + "my_join_field": { + "type": "join", + "relations": { + "question": "answer" + }, + "eager_global_ordinals": false } } } @@ -355,16 +347,14 @@ It is also possible to define multiple children for a single parent: [source,js] -------------------------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "my_join_field": { - "type": "join", - "relations": { - "question": ["answer", "comment"] <1> - } + "properties": { + "my_join_field": { + "type": "join", + "relations": { + "question": ["answer", "comment"] <1> } } } @@ -385,17 +375,15 @@ Multiple levels of parent/child: [source,js] -------------------------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "my_join_field": { - "type": "join", - "relations": { - "question": ["answer", "comment"], <1> - "answer": "vote" <2> - } + "properties": { + "my_join_field": { + "type": "join", + "relations": { + "question": ["answer", "comment"], <1> + "answer": "vote" <2> } } } @@ -423,7 +411,7 @@ to the grand-parent (the greater parent of the lineage): [source,js] -------------------------------------------------- -PUT my_index/_doc/3?routing=1&refresh <1> +PUT my_index/_doc/3?routing=1&refresh&include_type_name=false <1> { "text": "This is a vote", "my_join_field": { @@ -436,4 +424,4 @@ PUT my_index/_doc/3?routing=1&refresh <1> // TEST[continued] <1> This child document must be on the same shard than its grand-parent and parent -<2> The parent id of this document (must points to an `answer` document) \ No newline at end of file +<2> The parent id of this document (must points to an `answer` document) diff --git a/docs/reference/mapping/types/percolator.asciidoc b/docs/reference/mapping/types/percolator.asciidoc index e4502d37360c9..d1084499376b8 100644 --- a/docs/reference/mapping/types/percolator.asciidoc +++ b/docs/reference/mapping/types/percolator.asciidoc @@ -15,17 +15,15 @@ If the following mapping configures the `percolator` field type for the [source,js] -------------------------------------------------- -PUT my_index +PUT my_index?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "query": { - "type": "percolator" - }, - "field": { - "type": "text" - } + "properties": { + "query": { + "type": "percolator" + }, + "field": { + "type": "text" } } } @@ -38,7 +36,7 @@ Then you can index a query: [source,js] -------------------------------------------------- -PUT my_index/_doc/match_value +PUT my_index/_doc/match_value?include_type_name=false { "query" : { "match" : { @@ -70,17 +68,15 @@ Lets take a look at the following index with a percolator field type: [source,js] -------------------------------------------------- -PUT index +PUT index?include_type_name=false { "mappings": { - "_doc" : { - "properties": { - "query" : { - "type" : "percolator" - }, - "body" : { - "type": "text" - } + "properties": { + "query" : { + "type" : "percolator" + }, + "body" : { + "type": "text" } } } @@ -98,7 +94,7 @@ POST _aliases ] } -PUT queries/_doc/1?refresh +PUT queries/_doc/1?refresh&include_type_name=false { "query" : { "match" : { @@ -118,17 +114,15 @@ to read your queries you need to reindex your queries into a new index on the cu [source,js] -------------------------------------------------- -PUT new_index +PUT new_index?include_type_name=false { "mappings": { - "_doc" : { - "properties": { - "query" : { - "type" : "percolator" - }, - "body" : { - "type": "text" - } + "properties": { + "query" : { + "type" : "percolator" + }, + "body" : { + "type": "text" } } } @@ -171,7 +165,7 @@ Executing the `percolate` query via the `queries` alias: [source,js] -------------------------------------------------- -GET /queries/_search +GET /queries/_search?include_type_name=false { "query": { "percolate" : { @@ -205,7 +199,6 @@ now returns matches from the new index: "hits": [ { "_index": "new_index", <1> - "_type": "_doc", "_id": "1", "_score": 0.2876821, "_source": { @@ -267,7 +260,7 @@ with these settings and mapping: [source,js] -------------------------------------------------- -PUT /test_index +PUT /test_index?include_type_name=false { "settings": { "analysis": { @@ -280,15 +273,13 @@ PUT /test_index } }, "mappings": { - "_doc" : { - "properties": { - "query" : { - "type": "percolator" - }, - "body" : { - "type": "text", - "analyzer": "my_analyzer" <1> - } + "properties": { + "query" : { + "type": "percolator" + }, + "body" : { + "type": "text", + "analyzer": "my_analyzer" <1> } } } @@ -341,7 +332,7 @@ All the tokens in the returned order need to replace the query text in the perco [source,js] -------------------------------------------------- -PUT /test_index/_doc/1?refresh +PUT /test_index/_doc/1?refresh&include_type_name=false { "query" : { "match" : { @@ -366,7 +357,7 @@ At percolate time nothing changes and the `percolate` query can be defined norma [source,js] -------------------------------------------------- -GET /test_index/_search +GET /test_index/_search?include_type_name=false { "query": { "percolate" : { @@ -400,7 +391,6 @@ This results in a response like this: "hits": [ { "_index": "test_index", - "_type": "_doc", "_id": "1", "_score": 0.2876821, "_source": { @@ -437,7 +427,7 @@ Creating an index with custom analysis settings: [source,js] -------------------------------------------------- -PUT my_queries1 +PUT my_queries1?include_type_name=false { "settings": { "analysis": { @@ -461,19 +451,17 @@ PUT my_queries1 } }, "mappings": { - "query": { - "properties": { - "query": { - "type": "percolator" - }, - "my_field": { - "type": "text", - "fields": { - "prefix": { <3> - "type": "text", - "analyzer": "wildcard_prefix", - "search_analyzer": "standard" - } + "properties": { + "query": { + "type": "percolator" + }, + "my_field": { + "type": "text", + "fields": { + "prefix": { <3> + "type": "text", + "analyzer": "wildcard_prefix", + "search_analyzer": "standard" } } } @@ -508,7 +496,7 @@ this query below should be indexed: [source,js] -------------------------------------------------- -PUT /my_queries1/query/1?refresh +PUT /my_queries1/_doc/1?refresh&include_type_name=false { "query": { "term": { @@ -527,7 +515,7 @@ percolator query: [source,js] -------------------------------------------------- -GET /my_queries1/_search +GET /my_queries1/_search?include_type_name=false { "query": { "percolate": { @@ -559,7 +547,6 @@ GET /my_queries1/_search "hits": [ { "_index": "my_queries1", - "_type": "query", "_id": "1", "_score": 0.41501677, "_source": { @@ -587,7 +574,7 @@ before the `edge_ngram` token filter. [source,js] -------------------------------------------------- -PUT my_queries2 +PUT my_queries2?include_type_name=false { "settings": { "analysis": { @@ -620,19 +607,17 @@ PUT my_queries2 } }, "mappings": { - "query": { - "properties": { - "query": { - "type": "percolator" - }, - "my_field": { - "type": "text", - "fields": { - "suffix": { - "type": "text", - "analyzer": "wildcard_suffix", - "search_analyzer": "wildcard_suffix_search_time" <1> - } + "properties": { + "query": { + "type": "percolator" + }, + "my_field": { + "type": "text", + "fields": { + "suffix": { + "type": "text", + "analyzer": "wildcard_suffix", + "search_analyzer": "wildcard_suffix_search_time" <1> } } } @@ -665,7 +650,7 @@ the following query below should be indexed: [source,js] -------------------------------------------------- -PUT /my_queries2/query/2?refresh +PUT /my_queries2/_doc/2?refresh&include_type_name=false { "query": { "match": { <1> @@ -685,7 +670,7 @@ percolator query: [source,js] -------------------------------------------------- -GET /my_queries2/_search +GET /my_queries2/_search?include_type_name=false { "query": { "percolate": { diff --git a/docs/reference/mapping/types/range.asciidoc b/docs/reference/mapping/types/range.asciidoc index 082d012a49058..da0ce75f2bcfb 100644 --- a/docs/reference/mapping/types/range.asciidoc +++ b/docs/reference/mapping/types/range.asciidoc @@ -60,7 +60,7 @@ The following is an example of a <> on the `in [source,js] -------------------------------------------------- -GET range_index/_search +GET range_index/_search?include_type_name=false { "query" : { "term" : { @@ -92,7 +92,6 @@ The result produced by the above query. "hits" : [ { "_index" : "range_index", - "_type" : "_doc", "_id" : "1", "_score" : 1.0, "_source" : { @@ -114,7 +113,7 @@ The following is an example of a `date_range` query over the `date_range` field [source,js] -------------------------------------------------- -GET range_index/_search +GET range_index/_search?include_type_name=false { "query" : { "range" : { @@ -152,7 +151,6 @@ This query produces a similar result: "hits" : [ { "_index" : "range_index", - "_type" : "_doc", "_id" : "1", "_score" : 1.0, "_source" : { @@ -178,7 +176,7 @@ https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation[CIDR] [source,js] -------------------------------------------------- -PUT range_index/_mapping/_doc +PUT range_index/_mapping?include_type_name=false { "properties": { "ip_whitelist": { @@ -187,7 +185,7 @@ PUT range_index/_mapping/_doc } } -PUT range_index/_doc/2 +PUT range_index/_doc/2?include_type_name=false { "ip_whitelist" : "192.168.0.0/16" } diff --git a/docs/reference/mapping/types/token-count.asciidoc b/docs/reference/mapping/types/token-count.asciidoc index 6f3295fab5ebb..60267604bc747 100644 --- a/docs/reference/mapping/types/token-count.asciidoc +++ b/docs/reference/mapping/types/token-count.asciidoc @@ -34,7 +34,7 @@ PUT my_index/_doc/1 PUT my_index/_doc/2 { "name": "Rachel Alice Williams" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { diff --git a/docs/reference/modules/cross-cluster-search.asciidoc b/docs/reference/modules/cross-cluster-search.asciidoc index d6c65eaff0155..003fc886a1060 100644 --- a/docs/reference/modules/cross-cluster-search.asciidoc +++ b/docs/reference/modules/cross-cluster-search.asciidoc @@ -168,7 +168,7 @@ must be prefixed with the cluster alias separated by a `:` character: [source,js] -------------------------------------------------- -GET /cluster_one:twitter/_search +GET /cluster_one:twitter/_search?include_type_name=false { "query": { "match": { @@ -203,7 +203,6 @@ GET /cluster_one:twitter/_search "hits": [ { "_index": "cluster_one:twitter", - "_type": "_doc", "_id": "0", "_score": 1, "_source": { @@ -226,7 +225,7 @@ Indices can also be searched with the same name on different clusters: [source,js] -------------------------------------------------- -GET /cluster_one:twitter,twitter/_search +GET /cluster_one:twitter,twitter/_search?include_type_name=false { "query": { "match": { @@ -265,7 +264,6 @@ will be prefixed with their remote cluster name: "hits": [ { "_index": "cluster_one:twitter", - "_type": "_doc", "_id": "0", "_score": 1, "_source": { @@ -277,7 +275,6 @@ will be prefixed with their remote cluster name: }, { "_index": "twitter", - "_type": "_doc", "_id": "0", "_score": 2, "_source": { @@ -319,7 +316,7 @@ PUT _cluster/settings [source,js] -------------------------------------------------- -GET /cluster_one:twitter,cluster_two:twitter,twitter/_search <1> +GET /cluster_one:twitter,cluster_two:twitter,twitter/_search?include_type_name=false <1> { "query": { "match": { @@ -354,7 +351,6 @@ GET /cluster_one:twitter,cluster_two:twitter,twitter/_search <1> "hits": [ { "_index": "cluster_one:twitter", - "_type": "_doc", "_id": "0", "_score": 1, "_source": { @@ -366,7 +362,6 @@ GET /cluster_one:twitter,cluster_two:twitter,twitter/_search <1> }, { "_index": "twitter", - "_type": "_doc", "_id": "0", "_score": 2, "_source": { diff --git a/docs/reference/modules/indices/request_cache.asciidoc b/docs/reference/modules/indices/request_cache.asciidoc index fc04c5e9c63f6..78d4d0f86538f 100644 --- a/docs/reference/modules/indices/request_cache.asciidoc +++ b/docs/reference/modules/indices/request_cache.asciidoc @@ -84,7 +84,7 @@ caching on a *per-request* basis. If set, it overrides the index-level setting: [source,js] ----------------------------- -GET /my_index/_search?request_cache=true +GET /my_index/_search?request_cache=true&include_type_name=false { "size": 0, "aggs": { diff --git a/docs/reference/modules/scripting/engine.asciidoc b/docs/reference/modules/scripting/engine.asciidoc index da3b4529daacc..9125ff5133e71 100644 --- a/docs/reference/modules/scripting/engine.asciidoc +++ b/docs/reference/modules/scripting/engine.asciidoc @@ -26,7 +26,7 @@ of the script as the script source: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "query": { "function_score": { diff --git a/docs/reference/modules/scripting/fields.asciidoc b/docs/reference/modules/scripting/fields.asciidoc index bdd6c5785d81c..59b1614498c2b 100644 --- a/docs/reference/modules/scripting/fields.asciidoc +++ b/docs/reference/modules/scripting/fields.asciidoc @@ -56,7 +56,7 @@ PUT my_index/_doc/2?refresh "popularity": 5 } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "function_score": { @@ -94,7 +94,7 @@ PUT my_index/_doc/1?refresh "cost_price": 100 } -GET my_index/_search +GET my_index/_search?include_type_name=false { "script_fields": { "sales_price": { @@ -200,7 +200,7 @@ PUT my_index/_doc/1?refresh "last_name": "White" } -GET my_index/_search +GET my_index/_search?include_type_name=false { "script_fields": { "source": { diff --git a/docs/reference/modules/scripting/using.asciidoc b/docs/reference/modules/scripting/using.asciidoc index 725808e193640..93873705a1e5d 100644 --- a/docs/reference/modules/scripting/using.asciidoc +++ b/docs/reference/modules/scripting/using.asciidoc @@ -27,7 +27,7 @@ PUT my_index/_doc/1 "my_field": 5 } -GET my_index/_search +GET my_index/_search?include_type_name=false { "script_fields": { "my_doubled_field": { @@ -168,7 +168,7 @@ Stored scripts can be used by specifying the `id` parameters as follows: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "script": { diff --git a/docs/reference/query-dsl/bool-query.asciidoc b/docs/reference/query-dsl/bool-query.asciidoc index a7092aaaab113..0ef5709133dfe 100644 --- a/docs/reference/query-dsl/bool-query.asciidoc +++ b/docs/reference/query-dsl/bool-query.asciidoc @@ -46,7 +46,7 @@ final `_score` for each document. [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "query": { "bool" : { @@ -85,7 +85,7 @@ query has been specified: [source,js] --------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "bool": { @@ -105,7 +105,7 @@ all documents. [source,js] --------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "bool": { @@ -129,7 +129,7 @@ by the filter. [source,js] --------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "constant_score": { diff --git a/docs/reference/query-dsl/boosting-query.asciidoc b/docs/reference/query-dsl/boosting-query.asciidoc index 5bb07392ab78d..6887266c17ff2 100644 --- a/docs/reference/query-dsl/boosting-query.asciidoc +++ b/docs/reference/query-dsl/boosting-query.asciidoc @@ -8,7 +8,7 @@ overall score. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "boosting" : { diff --git a/docs/reference/query-dsl/common-terms-query.asciidoc b/docs/reference/query-dsl/common-terms-query.asciidoc index 87288778246a6..0808951bfa9c2 100644 --- a/docs/reference/query-dsl/common-terms-query.asciidoc +++ b/docs/reference/query-dsl/common-terms-query.asciidoc @@ -70,7 +70,7 @@ In this example, words that have a document frequency greater than 0.1% [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "common": { @@ -94,7 +94,7 @@ all terms required: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "common": { @@ -113,7 +113,7 @@ which is roughly equivalent to: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool": { @@ -140,7 +140,7 @@ must be present, for instance: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "common": { @@ -159,7 +159,7 @@ which is roughly equivalent to: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool": { @@ -192,7 +192,7 @@ additional parameters (note the change in structure): [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "common": { @@ -214,7 +214,7 @@ which is roughly equivalent to: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool": { @@ -253,7 +253,7 @@ for high frequency terms is when there are only high frequency terms: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "common": { @@ -275,7 +275,7 @@ which is roughly equivalent to: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool": { diff --git a/docs/reference/query-dsl/constant-score-query.asciidoc b/docs/reference/query-dsl/constant-score-query.asciidoc index aa7ee60aa5c6f..747f67b53bd25 100644 --- a/docs/reference/query-dsl/constant-score-query.asciidoc +++ b/docs/reference/query-dsl/constant-score-query.asciidoc @@ -7,7 +7,7 @@ filter. Maps to Lucene `ConstantScoreQuery`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "constant_score" : { diff --git a/docs/reference/query-dsl/dis-max-query.asciidoc b/docs/reference/query-dsl/dis-max-query.asciidoc index 1f9fc53d66d9f..8fa0157f42633 100644 --- a/docs/reference/query-dsl/dis-max-query.asciidoc +++ b/docs/reference/query-dsl/dis-max-query.asciidoc @@ -27,7 +27,7 @@ This query maps to Lucene `DisjunctionMaxQuery`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "dis_max" : { diff --git a/docs/reference/query-dsl/exists-query.asciidoc b/docs/reference/query-dsl/exists-query.asciidoc index f0e76852da1e3..3d16d9f3c546b 100644 --- a/docs/reference/query-dsl/exists-query.asciidoc +++ b/docs/reference/query-dsl/exists-query.asciidoc @@ -5,7 +5,7 @@ Returns documents that have at least one non-`null` value in the original field: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "exists" : { "field" : "user" } @@ -95,7 +95,7 @@ There isn't a `missing` query. Instead use the `exists` query inside a [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool": { diff --git a/docs/reference/query-dsl/feature-query.asciidoc b/docs/reference/query-dsl/feature-query.asciidoc index 387278a432af6..886038788097c 100644 --- a/docs/reference/query-dsl/feature-query.asciidoc +++ b/docs/reference/query-dsl/feature-query.asciidoc @@ -27,27 +27,25 @@ based or `pagerank`, `url_length` and the `sports` topic. [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "pagerank": { - "type": "feature" - }, - "url_length": { - "type": "feature", - "positive_score_impact": false - }, - "topics": { - "type": "feature_vector" - } + "properties": { + "pagerank": { + "type": "feature" + }, + "url_length": { + "type": "feature", + "positive_score_impact": false + }, + "topics": { + "type": "feature_vector" } } } } -PUT test/_doc/1 +PUT test/_doc/1?include_type_name=false { "url": "http://en.wikipedia.org/wiki/2016_Summer_Olympics", "content": "Rio 2016", @@ -59,7 +57,7 @@ PUT test/_doc/1 } } -PUT test/_doc/2 +PUT test/_doc/2?include_type_name=false { "url": "http://en.wikipedia.org/wiki/2016_Brazilian_Grand_Prix", "content": "Formula One motor race held on 13 November 2016 at the Autódromo José Carlos Pace in São Paulo, Brazil", @@ -72,7 +70,7 @@ PUT test/_doc/2 } } -PUT test/_doc/3 +PUT test/_doc/3?include_type_name=false { "url": "http://en.wikipedia.org/wiki/Deadpool_(film)", "content": "Deadpool is a 2016 American superhero film", @@ -86,7 +84,7 @@ PUT test/_doc/3 POST test/_refresh -GET test/_search +GET test/_search?include_type_name=false { "query": { "bool": { @@ -143,7 +141,7 @@ If the feature has a negative score impact then the function will be computed as [source,js] -------------------------------------------------- -GET test/_search +GET test/_search?include_type_name=false { "query": { "feature": { @@ -165,7 +163,7 @@ train a good pivot value. [source,js] -------------------------------------------------- -GET test/_search +GET test/_search?include_type_name=false { "query": { "feature": { @@ -189,7 +187,7 @@ This function only supports features that have a positive score impact. [source,js] -------------------------------------------------- -GET test/_search +GET test/_search?include_type_name=false { "query": { "feature": { @@ -218,7 +216,7 @@ that you stick to the `saturation` function instead. [source,js] -------------------------------------------------- -GET test/_search +GET test/_search?include_type_name=false { "query": { "feature": { diff --git a/docs/reference/query-dsl/function-score-query.asciidoc b/docs/reference/query-dsl/function-score-query.asciidoc index 4b4a82594a110..014ca3290fff5 100644 --- a/docs/reference/query-dsl/function-score-query.asciidoc +++ b/docs/reference/query-dsl/function-score-query.asciidoc @@ -14,7 +14,7 @@ by the query. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -37,7 +37,7 @@ given filtering query [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -134,7 +134,7 @@ simple sample: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -163,7 +163,7 @@ same script, and provide parameters to it: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -230,7 +230,7 @@ a lot of memory. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -259,7 +259,7 @@ doing so would look like: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -361,7 +361,7 @@ days, weeks, and so on. Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { @@ -559,7 +559,7 @@ the request would look like this: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "function_score": { diff --git a/docs/reference/query-dsl/fuzzy-query.asciidoc b/docs/reference/query-dsl/fuzzy-query.asciidoc index 4be546916240f..cf7cebf03196c 100644 --- a/docs/reference/query-dsl/fuzzy-query.asciidoc +++ b/docs/reference/query-dsl/fuzzy-query.asciidoc @@ -14,7 +14,7 @@ Here is a simple example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "fuzzy" : { "user" : "ki" } @@ -27,7 +27,7 @@ Or with more advanced settings: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "fuzzy" : { diff --git a/docs/reference/query-dsl/geo-bounding-box-query.asciidoc b/docs/reference/query-dsl/geo-bounding-box-query.asciidoc index fdf5ca5de16e5..9a6c87c93b622 100644 --- a/docs/reference/query-dsl/geo-bounding-box-query.asciidoc +++ b/docs/reference/query-dsl/geo-bounding-box-query.asciidoc @@ -41,7 +41,7 @@ Then the following simple query can be executed with a [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -96,7 +96,7 @@ representations of the geo point, the filter can accept it as well: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -131,7 +131,7 @@ conform with http://geojson.org/[GeoJSON]. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -159,7 +159,7 @@ Format in `lat,lon`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -185,7 +185,7 @@ GET /_search [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -210,7 +210,7 @@ GET /_search [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -245,7 +245,7 @@ geohash the geohash can be specified in both `top_left` and [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "geo_bounding_box" : { @@ -275,7 +275,7 @@ values separately. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -325,7 +325,7 @@ are not supported. Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { diff --git a/docs/reference/query-dsl/geo-distance-query.asciidoc b/docs/reference/query-dsl/geo-distance-query.asciidoc index 2bf24c942cbcc..1567bb5f3d64e 100644 --- a/docs/reference/query-dsl/geo-distance-query.asciidoc +++ b/docs/reference/query-dsl/geo-distance-query.asciidoc @@ -43,7 +43,7 @@ filter: [source,js] -------------------------------------------------- -GET /my_locations/_search +GET /my_locations/_search?include_type_name=false { "query": { "bool" : { @@ -76,7 +76,7 @@ representations of the geo point, the filter can accept it as well: [source,js] -------------------------------------------------- -GET /my_locations/_search +GET /my_locations/_search?include_type_name=false { "query": { "bool" : { @@ -106,7 +106,7 @@ conform with http://geojson.org/[GeoJSON]. [source,js] -------------------------------------------------- -GET /my_locations/_search +GET /my_locations/_search?include_type_name=false { "query": { "bool" : { @@ -133,7 +133,7 @@ Format in `lat,lon`. [source,js] -------------------------------------------------- -GET /my_locations/_search +GET /my_locations/_search?include_type_name=false { "query": { "bool" : { @@ -157,7 +157,7 @@ GET /my_locations/_search [source,js] -------------------------------------------------- -GET /my_locations/_search +GET /my_locations/_search?include_type_name=false { "query": { "bool" : { diff --git a/docs/reference/query-dsl/geo-polygon-query.asciidoc b/docs/reference/query-dsl/geo-polygon-query.asciidoc index 189f135fa3bc7..40915591eeac4 100644 --- a/docs/reference/query-dsl/geo-polygon-query.asciidoc +++ b/docs/reference/query-dsl/geo-polygon-query.asciidoc @@ -6,7 +6,7 @@ points. Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -54,7 +54,7 @@ conform with http://geojson.org/[GeoJSON]. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -85,7 +85,7 @@ Format in `lat,lon`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -114,7 +114,7 @@ GET /_search [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { diff --git a/docs/reference/query-dsl/geo-shape-query.asciidoc b/docs/reference/query-dsl/geo-shape-query.asciidoc index 4e00a2f49b475..1e8651baa385a 100644 --- a/docs/reference/query-dsl/geo-shape-query.asciidoc +++ b/docs/reference/query-dsl/geo-shape-query.asciidoc @@ -54,7 +54,7 @@ The following query will find the point using the Elasticsearch's [source,js] -------------------------------------------------- -GET /example/_search +GET /example/_search?include_type_name=false { "query":{ "bool": { @@ -121,7 +121,7 @@ PUT /shapes/_doc/deu } } -GET /example/_search +GET /example/_search?include_type_name=false { "query": { "bool": { diff --git a/docs/reference/query-dsl/has-child-query.asciidoc b/docs/reference/query-dsl/has-child-query.asciidoc index ca23afb0fae26..179526a5fe5e2 100644 --- a/docs/reference/query-dsl/has-child-query.asciidoc +++ b/docs/reference/query-dsl/has-child-query.asciidoc @@ -7,7 +7,7 @@ an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_child" : { @@ -44,7 +44,7 @@ inside the `has_child` query: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_child" : { @@ -70,7 +70,7 @@ a match: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_child" : { @@ -114,7 +114,7 @@ Sorting blogs by child documents' `click_count` field: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_child" : { diff --git a/docs/reference/query-dsl/has-parent-query.asciidoc b/docs/reference/query-dsl/has-parent-query.asciidoc index 4065a9d99fe2e..9758a42227b69 100644 --- a/docs/reference/query-dsl/has-parent-query.asciidoc +++ b/docs/reference/query-dsl/has-parent-query.asciidoc @@ -9,7 +9,7 @@ in the same manner as the `has_child` query. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_parent" : { @@ -45,7 +45,7 @@ matching parent document. The score mode can be specified with the [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_parent" : { @@ -83,7 +83,7 @@ Sorting tags by parent document' `view_count` field: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "has_parent" : { diff --git a/docs/reference/query-dsl/ids-query.asciidoc b/docs/reference/query-dsl/ids-query.asciidoc index 55adcb8f94cf8..f5a1e54cdaae0 100644 --- a/docs/reference/query-dsl/ids-query.asciidoc +++ b/docs/reference/query-dsl/ids-query.asciidoc @@ -6,7 +6,7 @@ uses the <> field. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "ids" : { diff --git a/docs/reference/query-dsl/match-all-query.asciidoc b/docs/reference/query-dsl/match-all-query.asciidoc index 6e44882867624..1b42f548b0ba4 100644 --- a/docs/reference/query-dsl/match-all-query.asciidoc +++ b/docs/reference/query-dsl/match-all-query.asciidoc @@ -6,7 +6,7 @@ of `1.0`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_all": {} @@ -19,7 +19,7 @@ The `_score` can be changed with the `boost` parameter: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_all": { "boost" : 1.2 } @@ -36,7 +36,7 @@ This is the inverse of the `match_all` query, which matches no documents. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_none": {} diff --git a/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc b/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc index 73f1be9143cf2..47b01ea22171c 100644 --- a/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc +++ b/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc @@ -6,7 +6,7 @@ allows for prefix matches on the last term in the text. For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_phrase_prefix" : { @@ -25,7 +25,7 @@ example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_phrase_prefix" : { diff --git a/docs/reference/query-dsl/match-phrase-query.asciidoc b/docs/reference/query-dsl/match-phrase-query.asciidoc index 1f4b19eedc132..ca581cee61205 100644 --- a/docs/reference/query-dsl/match-phrase-query.asciidoc +++ b/docs/reference/query-dsl/match-phrase-query.asciidoc @@ -6,7 +6,7 @@ out of the analyzed text. For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_phrase" : { @@ -26,7 +26,7 @@ definition, or the default search analyzer, for example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match_phrase" : { diff --git a/docs/reference/query-dsl/match-query.asciidoc b/docs/reference/query-dsl/match-query.asciidoc index 5c397d603bef3..16d294c9d88b3 100644 --- a/docs/reference/query-dsl/match-query.asciidoc +++ b/docs/reference/query-dsl/match-query.asciidoc @@ -7,7 +7,7 @@ them, and constructs a query. For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match" : { @@ -61,7 +61,7 @@ change in structure, `message` is the field name): [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match" : { @@ -84,7 +84,7 @@ change that the `zero_terms_query` option can be used, which accepts [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match" : { @@ -125,7 +125,7 @@ Here is an example showing a query composed of stopwords exclusively: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match" : { @@ -156,7 +156,7 @@ It is also possible to match multi terms synonyms with conjunctions instead: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "match" : { diff --git a/docs/reference/query-dsl/mlt-query.asciidoc b/docs/reference/query-dsl/mlt-query.asciidoc index 19035d96ae04d..9c240fbf0400d 100644 --- a/docs/reference/query-dsl/mlt-query.asciidoc +++ b/docs/reference/query-dsl/mlt-query.asciidoc @@ -14,7 +14,7 @@ fields, limiting the number of selected terms to 12. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "more_like_this" : { @@ -34,7 +34,7 @@ similar to the one used in the <>. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "more_like_this" : { @@ -66,7 +66,7 @@ present in the index, the syntax is similar to < "_index": "my-index", - "_type": "_doc", "_id": "1", "_score": 0.5753642, "_source": { @@ -152,7 +149,7 @@ the percolator query in a `bool` query's filter clause or in a `constant_score` [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query" : { "constant_score": { @@ -193,7 +190,7 @@ correlate with the slot in the `documents` array specified in the `percolate` qu [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query" : { "percolate" : { @@ -238,7 +235,6 @@ GET /my-index/_search "hits": [ { "_index": "my-index", - "_type": "_doc", "_id": "1", "_score": 1.5606477, "_source": { @@ -277,7 +273,7 @@ Index the document we want to percolate: [source,js] -------------------------------------------------- -PUT /my-index/_doc/2 +PUT /my-index/_doc/2?include_type_name=false { "message" : "A new bonsai tree in the office" } @@ -290,7 +286,6 @@ Index response: -------------------------------------------------- { "_index": "my-index", - "_type": "_doc", "_id": "2", "_version": 1, "_shards": { @@ -309,7 +304,7 @@ Percolating an existing document, using the index response as basis to build to [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query" : { "percolate" : { @@ -379,7 +374,7 @@ Execute a search request with the `percolate` query and highlighting enabled: [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query" : { "percolate" : { @@ -418,7 +413,6 @@ This will yield the following response. "hits": [ { "_index": "my-index", - "_type": "_doc", "_id": "3", "_score": 0.5753642, "_source": { @@ -439,7 +433,6 @@ This will yield the following response. }, { "_index": "my-index", - "_type": "_doc", "_id": "4", "_score": 0.5753642, "_source": { @@ -473,7 +466,7 @@ When percolating multiple documents at the same time like the request below then [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query" : { "percolate" : { @@ -523,7 +516,6 @@ The slightly different response: "hits": [ { "_index": "my-index", - "_type": "_doc", "_id": "1", "_score": 1.5606477, "_source": { @@ -564,7 +556,7 @@ It is possible to specify multiple `percolate` queries in a single search reques [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query" : { "bool" : { @@ -619,7 +611,6 @@ The above search request returns a response similar to this: "hits": [ { "_index": "my-index", - "_type": "_doc", "_id": "1", "_score": 0.5753642, "_source": { @@ -666,7 +657,7 @@ can be found by running the following search: [source,js] --------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "term" : { diff --git a/docs/reference/query-dsl/prefix-query.asciidoc b/docs/reference/query-dsl/prefix-query.asciidoc index 54d69583e990c..44923dfb1e2b6 100644 --- a/docs/reference/query-dsl/prefix-query.asciidoc +++ b/docs/reference/query-dsl/prefix-query.asciidoc @@ -8,7 +8,7 @@ that starts with `ki`: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "prefix" : { "user" : "ki" } } @@ -20,7 +20,7 @@ A boost can also be associated with the query: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "prefix" : { "user" : { "value" : "ki", "boost" : 2.0 } } } diff --git a/docs/reference/query-dsl/query-string-query.asciidoc b/docs/reference/query-dsl/query-string-query.asciidoc index 17d07e25259f5..816d406b5b781 100644 --- a/docs/reference/query-dsl/query-string-query.asciidoc +++ b/docs/reference/query-dsl/query-string-query.asciidoc @@ -6,7 +6,7 @@ an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -23,7 +23,7 @@ Each textual part is analyzed independently of each other. For instance the foll [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -159,7 +159,7 @@ For example, the following query [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -176,7 +176,7 @@ matches the same words as [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string": { @@ -193,7 +193,7 @@ For example (the `name` is boosted by 5 using `^5` notation): [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -213,7 +213,7 @@ search on all "city" fields: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -231,7 +231,7 @@ string itself (properly escaping the `*` sign), for example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -272,7 +272,7 @@ introduced fields included). For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { @@ -297,7 +297,7 @@ It is also possible to match multi terms synonyms with conjunctions instead: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string" : { diff --git a/docs/reference/query-dsl/query_filter_context.asciidoc b/docs/reference/query-dsl/query_filter_context.asciidoc index 79f8c4bd960b0..30452cff98870 100644 --- a/docs/reference/query-dsl/query_filter_context.asciidoc +++ b/docs/reference/query-dsl/query_filter_context.asciidoc @@ -47,7 +47,7 @@ conditions are met: [source,js] ------------------------------------ -GET /_search +GET /_search?include_type_name=false { "query": { <1> "bool": { <2> diff --git a/docs/reference/query-dsl/range-query.asciidoc b/docs/reference/query-dsl/range-query.asciidoc index 620a175ff39a5..98c60444de215 100644 --- a/docs/reference/query-dsl/range-query.asciidoc +++ b/docs/reference/query-dsl/range-query.asciidoc @@ -9,7 +9,7 @@ a `NumericRangeQuery`. The following example returns all documents where [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "range" : { @@ -42,7 +42,7 @@ specified using <>: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "range" : { @@ -94,7 +94,7 @@ passing the `format` parameter to the `range` query: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "range" : { @@ -123,7 +123,7 @@ accepts it), or it can be specified as the `time_zone` parameter: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "range" : { diff --git a/docs/reference/query-dsl/regexp-query.asciidoc b/docs/reference/query-dsl/regexp-query.asciidoc index b50b2ca8f5055..0fedd3f2c20ff 100644 --- a/docs/reference/query-dsl/regexp-query.asciidoc +++ b/docs/reference/query-dsl/regexp-query.asciidoc @@ -15,7 +15,7 @@ matchers like `.*?+` will mostly lower performance. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "regexp":{ @@ -30,7 +30,7 @@ Boosting is also supported [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "regexp":{ @@ -48,7 +48,7 @@ You can also use special flags [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "regexp":{ @@ -76,7 +76,7 @@ this limit to allow more complex regular expressions to execute. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "regexp":{ diff --git a/docs/reference/query-dsl/script-query.asciidoc b/docs/reference/query-dsl/script-query.asciidoc index a2bb49212034e..9398f04dc5a95 100644 --- a/docs/reference/query-dsl/script-query.asciidoc +++ b/docs/reference/query-dsl/script-query.asciidoc @@ -7,7 +7,7 @@ context, for example: [source,js] ---------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { @@ -34,7 +34,7 @@ to use the ability to pass parameters to the script itself, for example: [source,js] ---------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { diff --git a/docs/reference/query-dsl/simple-query-string-query.asciidoc b/docs/reference/query-dsl/simple-query-string-query.asciidoc index 99fbc131c1be3..d188a647c9e0e 100644 --- a/docs/reference/query-dsl/simple-query-string-query.asciidoc +++ b/docs/reference/query-dsl/simple-query-string-query.asciidoc @@ -8,7 +8,7 @@ an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "simple_query_string" : { @@ -102,7 +102,7 @@ Be aware that this syntax may have a different behavior depending on the [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "simple_query_string" : { @@ -137,7 +137,7 @@ introduced fields included). For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "simple_query_string" : { @@ -157,7 +157,7 @@ should be enabled. It is specified as a `|`-delimited string with the [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "simple_query_string" : { @@ -185,7 +185,7 @@ It is also possible to match multi terms synonyms with conjunctions instead: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "simple_query_string" : { diff --git a/docs/reference/query-dsl/span-containing-query.asciidoc b/docs/reference/query-dsl/span-containing-query.asciidoc index 638c699923305..25284e7430520 100644 --- a/docs/reference/query-dsl/span-containing-query.asciidoc +++ b/docs/reference/query-dsl/span-containing-query.asciidoc @@ -6,7 +6,7 @@ query maps to Lucene `SpanContainingQuery`. Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_containing" : { diff --git a/docs/reference/query-dsl/span-field-masking-query.asciidoc b/docs/reference/query-dsl/span-field-masking-query.asciidoc index d9e96635a29c4..7ee5ea71d3599 100644 --- a/docs/reference/query-dsl/span-field-masking-query.asciidoc +++ b/docs/reference/query-dsl/span-field-masking-query.asciidoc @@ -11,7 +11,7 @@ Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_near": { diff --git a/docs/reference/query-dsl/span-first-query.asciidoc b/docs/reference/query-dsl/span-first-query.asciidoc index dba7932661deb..29640e196d9eb 100644 --- a/docs/reference/query-dsl/span-first-query.asciidoc +++ b/docs/reference/query-dsl/span-first-query.asciidoc @@ -6,7 +6,7 @@ to Lucene `SpanFirstQuery`. Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_first" : { diff --git a/docs/reference/query-dsl/span-multi-term-query.asciidoc b/docs/reference/query-dsl/span-multi-term-query.asciidoc index de78d80284ed2..170e7478eeed5 100644 --- a/docs/reference/query-dsl/span-multi-term-query.asciidoc +++ b/docs/reference/query-dsl/span-multi-term-query.asciidoc @@ -7,7 +7,7 @@ it can be nested. Example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_multi":{ @@ -24,7 +24,7 @@ A boost can also be associated with the query: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_multi":{ diff --git a/docs/reference/query-dsl/span-near-query.asciidoc b/docs/reference/query-dsl/span-near-query.asciidoc index e69be783e3d60..2c1a7682c08b3 100644 --- a/docs/reference/query-dsl/span-near-query.asciidoc +++ b/docs/reference/query-dsl/span-near-query.asciidoc @@ -8,7 +8,7 @@ matches are required to be in-order. The span near query maps to Lucene [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_near" : { diff --git a/docs/reference/query-dsl/span-not-query.asciidoc b/docs/reference/query-dsl/span-not-query.asciidoc index 29a803a74767b..e556a1f4e3c00 100644 --- a/docs/reference/query-dsl/span-not-query.asciidoc +++ b/docs/reference/query-dsl/span-not-query.asciidoc @@ -8,7 +8,7 @@ query maps to Lucene `SpanNotQuery`. Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_not" : { diff --git a/docs/reference/query-dsl/span-or-query.asciidoc b/docs/reference/query-dsl/span-or-query.asciidoc index 470935d6f5c4a..fab4a394a34ff 100644 --- a/docs/reference/query-dsl/span-or-query.asciidoc +++ b/docs/reference/query-dsl/span-or-query.asciidoc @@ -6,7 +6,7 @@ Matches the union of its span clauses. The span or query maps to Lucene [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_or" : { diff --git a/docs/reference/query-dsl/span-term-query.asciidoc b/docs/reference/query-dsl/span-term-query.asciidoc index 1b12a3c35f796..72162b8dcbd9d 100644 --- a/docs/reference/query-dsl/span-term-query.asciidoc +++ b/docs/reference/query-dsl/span-term-query.asciidoc @@ -6,7 +6,7 @@ Matches spans containing a term. The span term query maps to Lucene [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_term" : { "user" : "kimchy" } @@ -19,7 +19,7 @@ A boost can also be associated with the query: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_term" : { "user" : { "value" : "kimchy", "boost" : 2.0 } } @@ -32,7 +32,7 @@ Or : [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_term" : { "user" : { "term" : "kimchy", "boost" : 2.0 } } diff --git a/docs/reference/query-dsl/span-within-query.asciidoc b/docs/reference/query-dsl/span-within-query.asciidoc index b70835c4134b4..ff00acc5c364e 100644 --- a/docs/reference/query-dsl/span-within-query.asciidoc +++ b/docs/reference/query-dsl/span-within-query.asciidoc @@ -6,7 +6,7 @@ query maps to Lucene `SpanWithinQuery`. Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "span_within" : { diff --git a/docs/reference/query-dsl/term-query.asciidoc b/docs/reference/query-dsl/term-query.asciidoc index f1224f33ca7d4..a04c02083b16f 100644 --- a/docs/reference/query-dsl/term-query.asciidoc +++ b/docs/reference/query-dsl/term-query.asciidoc @@ -6,7 +6,7 @@ in the inverted index. For instance: [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "query": { "term" : { "user" : "Kimchy" } <1> @@ -22,7 +22,7 @@ relevance score than another query, for instance: [source,js] -------------------------------------------------- -GET _search +GET _search?include_type_name=false { "query": { "bool": { @@ -120,7 +120,7 @@ Now, compare the results for the `term` query and the `match` query: [source,js] -------------------------------------------------- -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -129,7 +129,7 @@ GET my_index/_search } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -138,7 +138,7 @@ GET my_index/_search } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "term": { @@ -147,7 +147,7 @@ GET my_index/_search } } -GET my_index/_search +GET my_index/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/query-dsl/terms-query.asciidoc b/docs/reference/query-dsl/terms-query.asciidoc index c0e94900d7d82..dbcb8d074072e 100644 --- a/docs/reference/query-dsl/terms-query.asciidoc +++ b/docs/reference/query-dsl/terms-query.asciidoc @@ -6,7 +6,7 @@ Filters documents that have fields that match any of the provided terms [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "terms" : { "user" : ["kimchy", "elasticsearch"]} @@ -87,7 +87,7 @@ PUT /tweets/_doc/1 "user" : "1" } -GET /tweets/_search +GET /tweets/_search?include_type_name=false { "query" : { "terms" : { diff --git a/docs/reference/query-dsl/terms-set-query.asciidoc b/docs/reference/query-dsl/terms-set-query.asciidoc index 29b349c3b7adb..41dc383a1578e 100644 --- a/docs/reference/query-dsl/terms-set-query.asciidoc +++ b/docs/reference/query-dsl/terms-set-query.asciidoc @@ -46,7 +46,7 @@ An example that uses the minimum should match field: [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query": { "terms_set": { @@ -79,7 +79,6 @@ Response: "hits": [ { "_index": "my-index", - "_type": "_doc", "_id": "2", "_score": 0.87546873, "_source": { @@ -105,7 +104,7 @@ become larger than the number of terms specified: [source,js] -------------------------------------------------- -GET /my-index/_search +GET /my-index/_search?include_type_name=false { "query": { "terms_set": { diff --git a/docs/reference/query-dsl/type-query.asciidoc b/docs/reference/query-dsl/type-query.asciidoc index 96edda27eff41..7f50e5f3d82a8 100644 --- a/docs/reference/query-dsl/type-query.asciidoc +++ b/docs/reference/query-dsl/type-query.asciidoc @@ -5,7 +5,7 @@ Filters documents matching the provided document / mapping type. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "type" : { diff --git a/docs/reference/query-dsl/wildcard-query.asciidoc b/docs/reference/query-dsl/wildcard-query.asciidoc index ba1c72bb1e53b..ef3f901aead89 100644 --- a/docs/reference/query-dsl/wildcard-query.asciidoc +++ b/docs/reference/query-dsl/wildcard-query.asciidoc @@ -11,7 +11,7 @@ query maps to Lucene `WildcardQuery`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "wildcard" : { "user" : "ki*y" } @@ -24,7 +24,7 @@ A boost can also be associated with the query: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "wildcard" : { "user" : { "value" : "ki*y", "boost" : 2.0 } } @@ -37,7 +37,7 @@ Or : [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "wildcard" : { "user" : { "wildcard" : "ki*y", "boost" : 2.0 } } diff --git a/docs/reference/query-dsl/wrapper-query.asciidoc b/docs/reference/query-dsl/wrapper-query.asciidoc index 4ffef5bfc6bcc..0fb1bea3c1e6e 100644 --- a/docs/reference/query-dsl/wrapper-query.asciidoc +++ b/docs/reference/query-dsl/wrapper-query.asciidoc @@ -5,7 +5,7 @@ A query that accepts any other query as base64 encoded string. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "wrapper": { diff --git a/docs/reference/redirects.asciidoc b/docs/reference/redirects.asciidoc index f07d1d09747e7..0bd5fec2470b6 100644 --- a/docs/reference/redirects.asciidoc +++ b/docs/reference/redirects.asciidoc @@ -377,7 +377,7 @@ the following: [source,js] ------------------------- ## INCORRECT - DEPRECATED SYNTAX, DO NOT USE -GET _search +GET _search?include_type_name=false { "query": { "filtered": { @@ -402,7 +402,7 @@ query: [source,js] ------------------------- -GET _search +GET _search?include_type_name=false { "query": { "bool": { diff --git a/docs/reference/rollup/apis/rollup-search.asciidoc b/docs/reference/rollup/apis/rollup-search.asciidoc index 8e7fc69a00a6b..b11fa39b64858 100644 --- a/docs/reference/rollup/apis/rollup-search.asciidoc +++ b/docs/reference/rollup/apis/rollup-search.asciidoc @@ -88,7 +88,7 @@ rolled-up data: [source,js] -------------------------------------------------- -GET /sensor_rollup/_rollup_search +GET /sensor_rollup/_rollup_search?include_type_name=false { "size": 0, "aggregations": { @@ -138,7 +138,7 @@ to execute that search: [source,js] -------------------------------------------------- -GET sensor_rollup/_rollup_search +GET sensor_rollup/_rollup_search?include_type_name=false { "size": 0, "aggregations": { diff --git a/docs/reference/rollup/rollup-getting-started.asciidoc b/docs/reference/rollup/rollup-getting-started.asciidoc index 8f99bc2c010ce..c99f3e86efe84 100644 --- a/docs/reference/rollup/rollup-getting-started.asciidoc +++ b/docs/reference/rollup/rollup-getting-started.asciidoc @@ -129,7 +129,7 @@ For example, take this query: [source,js] -------------------------------------------------- -GET /sensor_rollup/_rollup_search +GET /sensor_rollup/_rollup_search?include_type_name=false { "size": 0, "aggregations": { @@ -184,7 +184,7 @@ Finally, we can use those grouping fields we defined to construct a more complic [source,js] -------------------------------------------------- -GET /sensor_rollup/_rollup_search +GET /sensor_rollup/_rollup_search?include_type_name=false { "size": 0, "aggregations": { diff --git a/docs/reference/rollup/rollup-search-limitations.asciidoc b/docs/reference/rollup/rollup-search-limitations.asciidoc index b61d1a743880f..a90b8468c7cac 100644 --- a/docs/reference/rollup/rollup-search-limitations.asciidoc +++ b/docs/reference/rollup/rollup-search-limitations.asciidoc @@ -41,7 +41,7 @@ the usage of `avg` here is not allowed: [source,js] -------------------------------------------------- -GET sensor_rollup/_rollup_search +GET sensor_rollup/_rollup_search?include_type_name=false { "size": 0, "aggregations": { diff --git a/docs/reference/search.asciidoc b/docs/reference/search.asciidoc index c73642c67131a..c5c9853787e8b 100644 --- a/docs/reference/search.asciidoc +++ b/docs/reference/search.asciidoc @@ -19,7 +19,7 @@ the user name: [source,js] -------------------------------------------------- -POST /twitter/tweet?routing=kimchy +POST twitter/_doc?routing=kimchy&include_type_name=false { "user" : "kimchy", "postDate" : "2009-11-15T14:12:12", @@ -34,7 +34,7 @@ only the relevant shard: [source,js] -------------------------------------------------- -POST /twitter/_search?routing=kimchy +POST twitter/_search?routing=kimchy&include_type_name=false { "query": { "bool" : { @@ -100,7 +100,7 @@ the request with two different groups: [source,js] -------------------------------------------------- -POST /_search +POST _search?include_type_name=false { "query" : { "match_all" : {} diff --git a/docs/reference/search/profile.asciidoc b/docs/reference/search/profile.asciidoc index bc7edcd3a88fa..ffb5ecc27ec43 100644 --- a/docs/reference/search/profile.asciidoc +++ b/docs/reference/search/profile.asciidoc @@ -17,7 +17,7 @@ Any `_search` request can be profiled by adding a top-level `profile` parameter: [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "profile": true,<1> "query" : { @@ -490,7 +490,7 @@ To demonstrate a slightly more complex query and the associated results, we can [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "profile": true, "query": { @@ -683,7 +683,7 @@ execute the previous query again and look at the aggregation profile this time: [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "profile": true, "query": { diff --git a/docs/reference/search/request-body.asciidoc b/docs/reference/search/request-body.asciidoc index 5be54662d012c..549a43ee880e1 100644 --- a/docs/reference/search/request-body.asciidoc +++ b/docs/reference/search/request-body.asciidoc @@ -7,7 +7,7 @@ example: [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "query" : { "term" : { "user" : "kimchy" } @@ -36,7 +36,6 @@ And here is a sample response: "hits" : [ { "_index" : "twitter", - "_type" : "_doc", "_id" : "0", "_score": 1.3862944, "_source" : { @@ -137,7 +136,7 @@ matching document was found (per shard). [source,js] -------------------------------------------------- -GET /_search?q=message:number&size=0&terminate_after=1 +GET /_search?q=message:number&size=0&terminate_after=1&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] diff --git a/docs/reference/search/request/collapse.asciidoc b/docs/reference/search/request/collapse.asciidoc index 1ab79e36c7e9d..5bb9ff38b2211 100644 --- a/docs/reference/search/request/collapse.asciidoc +++ b/docs/reference/search/request/collapse.asciidoc @@ -7,7 +7,7 @@ For instance the query below retrieves the best tweet for each user and sorts th [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "query": { "match": { @@ -41,7 +41,7 @@ It is also possible to expand each collapsed top hits with the `inner_hits` opti [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "query": { "match": { @@ -75,7 +75,7 @@ multiple representations of the collapsed hits. [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "query": { "match": { @@ -126,7 +126,7 @@ for each user. [source,js] -------------------------------------------------- -GET /twitter/_search +GET /twitter/_search?include_type_name=false { "query": { "match": { diff --git a/docs/reference/search/request/docvalue-fields.asciidoc b/docs/reference/search/request/docvalue-fields.asciidoc index bcfcb20d1d53b..e057c47efce94 100644 --- a/docs/reference/search/request/docvalue-fields.asciidoc +++ b/docs/reference/search/request/docvalue-fields.asciidoc @@ -6,7 +6,7 @@ example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match_all": {} @@ -34,7 +34,7 @@ Doc value fields can work on fields that are not stored. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match_all": {} diff --git a/docs/reference/search/request/explain.asciidoc b/docs/reference/search/request/explain.asciidoc index 9bcaecb484060..89d224ef2d769 100644 --- a/docs/reference/search/request/explain.asciidoc +++ b/docs/reference/search/request/explain.asciidoc @@ -5,7 +5,7 @@ Enables explanation for each hit on how its score was computed. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "explain": true, "query" : { diff --git a/docs/reference/search/request/from-size.asciidoc b/docs/reference/search/request/from-size.asciidoc index 1c44a7ca8d286..1e3cc2d292483 100644 --- a/docs/reference/search/request/from-size.asciidoc +++ b/docs/reference/search/request/from-size.asciidoc @@ -12,7 +12,7 @@ defaults to `10`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "from" : 0, "size" : 10, "query" : { diff --git a/docs/reference/search/request/highlighters-internal.asciidoc b/docs/reference/search/request/highlighters-internal.asciidoc index 651cdf917ced0..49502d5d64b66 100644 --- a/docs/reference/search/request/highlighters-internal.asciidoc +++ b/docs/reference/search/request/highlighters-internal.asciidoc @@ -119,7 +119,7 @@ And we ran the following query with a highlight request: [source,js] -------------------------------------------------- -GET test_index/_search +GET test_index/_search?include_type_name=false { "query": { "match_phrase" : {"content" : "only fox"} diff --git a/docs/reference/search/request/highlighting.asciidoc b/docs/reference/search/request/highlighting.asciidoc index 2da11c14b5804..55eb6b51cabbd 100644 --- a/docs/reference/search/request/highlighting.asciidoc +++ b/docs/reference/search/request/highlighting.asciidoc @@ -22,7 +22,7 @@ the request body that specifies the `content` field: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "content": "kimchy" } @@ -274,7 +274,7 @@ individual fields. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -305,7 +305,7 @@ highlighting would only take the search query into account. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "stored_fields": [ "_id" ], "query" : { @@ -374,7 +374,7 @@ The following is an example that forces the use of the plain highlighter: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -399,7 +399,7 @@ for example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -421,7 +421,7 @@ When using the fast vector highlighter, you can specify additional tags and the [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -442,7 +442,7 @@ You can also use the built-in `styled` tag schema: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -467,7 +467,7 @@ are stored separately. Defaults to `false`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -492,7 +492,7 @@ By default, only fields that contains a query match are highlighted. Set [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -526,7 +526,7 @@ analyzer and `comment.plain` is analyzed by the `standard` analyzer. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string": { @@ -556,7 +556,7 @@ are more matches in that fragment. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string": { @@ -584,7 +584,7 @@ the plain match ("running") is boosted. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "query_string": { @@ -654,7 +654,7 @@ in which fields are highlighted specify the `fields` as an array: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "highlight": { "fields": [ @@ -684,7 +684,7 @@ For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -704,7 +704,7 @@ to be sorted by score: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -728,7 +728,7 @@ is required. Note that `fragment_size` is ignored in this case. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -755,7 +755,7 @@ specified as it tries to break on a word boundary. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match": { "user": "kimchy" } @@ -829,7 +829,7 @@ When using the `plain` highlighter, you can choose between the `simple` and [source,js] -------------------------------------------------- -GET twitter/_search +GET twitter/_search?include_type_name=false { "query" : { "match_phrase": { "message": "number 1" } @@ -861,7 +861,6 @@ Response: "hits": [ { "_index": "twitter", - "_type": "_doc", "_id": "1", "_score": 1.601195, "_source": { @@ -885,7 +884,7 @@ Response: [source,js] -------------------------------------------------- -GET twitter/_search +GET twitter/_search?include_type_name=false { "query" : { "match_phrase": { "message": "number 1" } @@ -917,7 +916,6 @@ Response: "hits": [ { "_index": "twitter", - "_type": "_doc", "_id": "1", "_score": 1.601195, "_source": { diff --git a/docs/reference/search/request/index-boost.asciidoc b/docs/reference/search/request/index-boost.asciidoc index 683fe910f5e6e..950889b143161 100644 --- a/docs/reference/search/request/index-boost.asciidoc +++ b/docs/reference/search/request/index-boost.asciidoc @@ -9,7 +9,7 @@ graph where each user has an index). deprecated[5.2.0, This format is deprecated. Please use array format instead.] [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "indices_boost" : { "index1" : 1.4, @@ -24,7 +24,7 @@ You can also specify it as an array to control the order of boosts. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "indices_boost" : [ { "alias1" : 1.4 }, diff --git a/docs/reference/search/request/inner-hits.asciidoc b/docs/reference/search/request/inner-hits.asciidoc index 8e719a02c759b..bd7cc1a4d90ad 100644 --- a/docs/reference/search/request/inner-hits.asciidoc +++ b/docs/reference/search/request/inner-hits.asciidoc @@ -84,20 +84,18 @@ The nested `inner_hits` can be used to include nested inner objects as inner hit [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "comments": { - "type": "nested" - } + "properties": { + "comments": { + "type": "nested" } } } } -PUT test/_doc/1?refresh +PUT test/_doc/1?refresh&include_type_name=false { "title": "Test title", "comments": [ @@ -112,7 +110,7 @@ PUT test/_doc/1?refresh ] } -POST test/_search +POST test/_search?include_type_name=false { "query": { "nested": { @@ -141,7 +139,6 @@ An example of a response snippet that could be generated from the above search r "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_score": 1.0, "_source": ..., @@ -153,7 +150,6 @@ An example of a response snippet that could be generated from the above search r "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_nested": { "field": "comments", @@ -204,20 +200,18 @@ including the source and solely rely on doc values fields. Like this: [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "comments": { - "type": "nested" - } + "properties": { + "comments": { + "type": "nested" } } } } -PUT test/_doc/1?refresh +PUT test/_doc/1?refresh&include_type_name=false { "title": "Test title", "comments": [ @@ -232,7 +226,7 @@ PUT test/_doc/1?refresh ] } -POST test/_search +POST test/_search?include_type_name=false { "query": { "nested": { @@ -269,7 +263,6 @@ Response not included in text but tested for completeness sake. "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_score": 1.0444684, "_source": ..., @@ -281,7 +274,6 @@ Response not included in text but tested for completeness sake. "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_nested": { "field": "comments", @@ -317,17 +309,15 @@ with the root hits then the following path can be defined: [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "comments": { - "type": "nested", - "properties": { - "votes": { - "type": "nested" - } + "properties": { + "comments": { + "type": "nested", + "properties": { + "votes": { + "type": "nested" } } } @@ -335,7 +325,7 @@ PUT test } } -PUT test/_doc/1?refresh +PUT test/_doc/1?refresh&include_type_name=false { "title": "Test title", "comments": [ @@ -355,7 +345,7 @@ PUT test/_doc/1?refresh ] } -POST test/_search +POST test/_search?include_type_name=false { "query": { "nested": { @@ -384,7 +374,6 @@ Which would look like: "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_score": 0.6931472, "_source": ..., @@ -396,7 +385,6 @@ Which would look like: "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_nested": { "field": "comments", @@ -433,29 +421,27 @@ The parent/child `inner_hits` can be used to include parent or child: [source,js] -------------------------------------------------- -PUT test +PUT test?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "my_join_field": { - "type": "join", - "relations": { - "my_parent": "my_child" - } + "properties": { + "my_join_field": { + "type": "join", + "relations": { + "my_parent": "my_child" } } } } } -PUT test/_doc/1?refresh +PUT test/_doc/1?refresh&include_type_name=false { "number": 1, "my_join_field": "my_parent" } -PUT test/_doc/2?routing=1&refresh +PUT test/_doc/2?routing=1&refresh&include_type_name=false { "number": 1, "my_join_field": { @@ -464,7 +450,7 @@ PUT test/_doc/2?routing=1&refresh } } -POST test/_search +POST test/_search?include_type_name=false { "query": { "has_child": { @@ -495,7 +481,6 @@ An example of a response snippet that could be generated from the above search r "hits": [ { "_index": "test", - "_type": "_doc", "_id": "1", "_score": 1.0, "_source": { @@ -510,7 +495,6 @@ An example of a response snippet that could be generated from the above search r "hits": [ { "_index": "test", - "_type": "_doc", "_id": "2", "_score": 1.0, "_routing": "1", diff --git a/docs/reference/search/request/min-score.asciidoc b/docs/reference/search/request/min-score.asciidoc index d9dbef99ddfc5..ca13ac9f8457e 100644 --- a/docs/reference/search/request/min-score.asciidoc +++ b/docs/reference/search/request/min-score.asciidoc @@ -6,7 +6,7 @@ in `min_score`: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "min_score": 0.5, "query" : { diff --git a/docs/reference/search/request/named-queries-and-filters.asciidoc b/docs/reference/search/request/named-queries-and-filters.asciidoc index 0fb602539386e..4366639f32a9e 100644 --- a/docs/reference/search/request/named-queries-and-filters.asciidoc +++ b/docs/reference/search/request/named-queries-and-filters.asciidoc @@ -5,7 +5,7 @@ Each filter and query can accept a `_name` in its top level definition. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query": { "bool" : { diff --git a/docs/reference/search/request/post-filter.asciidoc b/docs/reference/search/request/post-filter.asciidoc index 636824bc067ca..c29f925a67f31 100644 --- a/docs/reference/search/request/post-filter.asciidoc +++ b/docs/reference/search/request/post-filter.asciidoc @@ -9,20 +9,18 @@ Imagine that you are selling shirts that have the following properties: [source,js] -------------------------------------------------- -PUT /shirts +PUT /shirts?include_type_name=false { "mappings": { - "_doc": { - "properties": { - "brand": { "type": "keyword"}, - "color": { "type": "keyword"}, - "model": { "type": "keyword"} - } + "properties": { + "brand": { "type": "keyword"}, + "color": { "type": "keyword"}, + "model": { "type": "keyword"} } } } -PUT /shirts/_doc/1?refresh +PUT /shirts/_doc/1?refresh&include_type_name=false { "brand": "gucci", "color": "red", @@ -41,7 +39,7 @@ Gucci in the search results. Normally you would do this with a [source,js] -------------------------------------------------- -GET /shirts/_search +GET /shirts/_search?include_type_name=false { "query": { "bool": { @@ -65,7 +63,7 @@ This can be done with a [source,js] -------------------------------------------------- -GET /shirts/_search +GET /shirts/_search?include_type_name=false { "query": { "bool": { @@ -96,7 +94,7 @@ the `post_filter`: [source,js] -------------------------------------------------- -GET /shirts/_search +GET /shirts/_search?include_type_name=false { "query": { "bool": { diff --git a/docs/reference/search/request/preference.asciidoc b/docs/reference/search/request/preference.asciidoc index 5f3fcb2efa6b7..fc213a5e919a5 100644 --- a/docs/reference/search/request/preference.asciidoc +++ b/docs/reference/search/request/preference.asciidoc @@ -53,7 +53,7 @@ For instance, use the user's session ID `xyzabc123` as follows: [source,js] ------------------------------------------------ -GET /_search?preference=xyzabc123 +GET /_search?preference=xyzabc123&include_type_name=false { "query": { "match": { diff --git a/docs/reference/search/request/query.asciidoc b/docs/reference/search/request/query.asciidoc index fa06d0d9bb40f..f8efbad9c848f 100644 --- a/docs/reference/search/request/query.asciidoc +++ b/docs/reference/search/request/query.asciidoc @@ -6,7 +6,7 @@ query using the <>. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "term" : { "user" : "kimchy" } diff --git a/docs/reference/search/request/rescore.asciidoc b/docs/reference/search/request/rescore.asciidoc index c2277aada3f52..fc9efb5dcb7a5 100644 --- a/docs/reference/search/request/rescore.asciidoc +++ b/docs/reference/search/request/rescore.asciidoc @@ -41,7 +41,7 @@ For example: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "query" : { "match" : { @@ -89,7 +89,7 @@ It is also possible to execute multiple rescores in sequence: [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "query" : { "match" : { diff --git a/docs/reference/search/request/script-fields.asciidoc b/docs/reference/search/request/script-fields.asciidoc index da5868ea7d65e..e87cd698ab870 100644 --- a/docs/reference/search/request/script-fields.asciidoc +++ b/docs/reference/search/request/script-fields.asciidoc @@ -6,7 +6,7 @@ evaluation>> (based on different fields) for each hit, for example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match_all": {} @@ -43,7 +43,7 @@ Here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "match_all": {} diff --git a/docs/reference/search/request/scroll.asciidoc b/docs/reference/search/request/scroll.asciidoc index c2d6dab550cc7..4e79802c76283 100644 --- a/docs/reference/search/request/scroll.asciidoc +++ b/docs/reference/search/request/scroll.asciidoc @@ -38,7 +38,7 @@ should keep the ``search context'' alive (see <>), eg `?s [source,js] -------------------------------------------------- -POST /twitter/_search?scroll=1m +POST /twitter/_search?scroll=1m&include_type_name=false { "size": 100, "query": { @@ -91,7 +91,7 @@ order, this is the most efficient option: [source,js] -------------------------------------------------- -GET /_search?scroll=1m +GET /_search?scroll=1m&include_type_name=false { "sort": [ "_doc" @@ -191,7 +191,7 @@ can be consumed independently: [source,js] -------------------------------------------------- -GET /twitter/_search?scroll=1m +GET /twitter/_search?scroll=1m&include_type_name=false { "slice": { "id": 0, <1> @@ -203,7 +203,7 @@ GET /twitter/_search?scroll=1m } } } -GET /twitter/_search?scroll=1m +GET /twitter/_search?scroll=1m&include_type_name=false { "slice": { "id": 1, @@ -254,7 +254,7 @@ slice gets deterministic results. [source,js] -------------------------------------------------- -GET /twitter/_search?scroll=1m +GET /twitter/_search?scroll=1m&include_type_name=false { "slice": { "field": "date", diff --git a/docs/reference/search/request/search-after.asciidoc b/docs/reference/search/request/search-after.asciidoc index ed4b35a090ae8..83172b1ecb49b 100644 --- a/docs/reference/search/request/search-after.asciidoc +++ b/docs/reference/search/request/search-after.asciidoc @@ -11,7 +11,7 @@ The idea is to use the results from the previous page to help the retrieval of t Suppose that the query to retrieve the first page looks like this: [source,js] -------------------------------------------------- -GET twitter/_search +GET twitter/_search?include_type_name=false { "size": 10, "query": { @@ -39,7 +39,7 @@ For instance we can use the `sort values` of the last document and pass it to `s [source,js] -------------------------------------------------- -GET twitter/_search +GET twitter/_search?include_type_name=false { "size": 10, "query": { diff --git a/docs/reference/search/request/sort.asciidoc b/docs/reference/search/request/sort.asciidoc index 544bea86b0dae..7a5dd4331b487 100644 --- a/docs/reference/search/request/sort.asciidoc +++ b/docs/reference/search/request/sort.asciidoc @@ -31,7 +31,7 @@ PUT /my_index [source,js] -------------------------------------------------- -GET /my_index/_search +GET /my_index/_search?include_type_name=false { "sort" : [ { "post_date" : {"order" : "asc"}}, @@ -98,7 +98,7 @@ PUT /my_index/_doc/1?refresh "price": [20, 4] } -POST /_search +POST /_search?include_type_name=false { "query" : { "term" : { "product" : "chocolate" } @@ -147,7 +147,7 @@ The nested `path` needs to be specified; otherwise, Elasticsearch doesn't know o [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "query" : { "term" : { "product" : "chocolate" } @@ -175,7 +175,7 @@ The `nested_path` needs to be specified at each level; otherwise, Elasticsearch [source,js] -------------------------------------------------- -POST /_search +POST /_search?include_type_name=false { "query": { "nested": { @@ -232,7 +232,7 @@ For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { "price" : {"missing" : "_last"} } @@ -257,7 +257,7 @@ example of how it can be used: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { "price" : {"unmapped_type" : "long"} } @@ -280,7 +280,7 @@ Allow to sort by `_geo_distance`. Here is an example, assuming `pin.location` is [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { @@ -334,7 +334,7 @@ The following formats are supported in providing the coordinates: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { @@ -361,7 +361,7 @@ Format in `lat,lon`. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { @@ -383,7 +383,7 @@ GET /_search [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { @@ -408,7 +408,7 @@ conform with http://geojson.org/[GeoJSON]. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { @@ -433,7 +433,7 @@ Multiple geo points can be passed as an array containing any `geo_point` format, [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "sort" : [ { @@ -463,7 +463,7 @@ Allow to sort based on custom scripts, here is an example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "query" : { "term" : { "user" : "kimchy" } @@ -493,7 +493,7 @@ When sorting on a field, scores are not computed. By setting [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "track_scores": true, "sort" : [ diff --git a/docs/reference/search/request/source-filtering.asciidoc b/docs/reference/search/request/source-filtering.asciidoc index 5f42b5422bca4..8c6c1f05ced9f 100644 --- a/docs/reference/search/request/source-filtering.asciidoc +++ b/docs/reference/search/request/source-filtering.asciidoc @@ -13,7 +13,7 @@ To disable `_source` retrieval set to `false`: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "_source": false, "query" : { @@ -29,7 +29,7 @@ For example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "_source": "obj.*", "query" : { @@ -43,7 +43,7 @@ Or [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "_source": [ "obj1.*", "obj2.*" ], "query" : { @@ -58,7 +58,7 @@ patterns: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "_source": { "includes": [ "obj1.*", "obj2.*" ], diff --git a/docs/reference/search/request/stored-fields.asciidoc b/docs/reference/search/request/stored-fields.asciidoc index 2feb9313d8a10..07d67e4e7d6db 100644 --- a/docs/reference/search/request/stored-fields.asciidoc +++ b/docs/reference/search/request/stored-fields.asciidoc @@ -11,7 +11,7 @@ by a search hit. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "stored_fields" : ["user", "postDate"], "query" : { @@ -28,7 +28,7 @@ returned, for example: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "stored_fields" : [], "query" : { @@ -55,7 +55,7 @@ To disable the stored fields (and metadata fields) entirely use: `_none_`: [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "stored_fields": "_none_", "query" : { diff --git a/docs/reference/search/request/version.asciidoc b/docs/reference/search/request/version.asciidoc index 57c6ce27feb91..173a70355cd53 100644 --- a/docs/reference/search/request/version.asciidoc +++ b/docs/reference/search/request/version.asciidoc @@ -5,7 +5,7 @@ Returns a version for each search hit. [source,js] -------------------------------------------------- -GET /_search +GET /_search?include_type_name=false { "version": true, "query" : { diff --git a/docs/reference/search/search-template.asciidoc b/docs/reference/search/search-template.asciidoc index 625dd94410945..09e700f901da5 100644 --- a/docs/reference/search/search-template.asciidoc +++ b/docs/reference/search/search-template.asciidoc @@ -6,7 +6,7 @@ before they are executed and fill existing templates with template parameters. [source,js] ------------------------------------------ -GET _search/template +GET _search/template?include_type_name=false { "source" : { "query": { "match" : { "{{my_field}}" : "{{my_value}}" } }, @@ -39,7 +39,7 @@ disable scripts per type and context as described in the [source,js] ------------------------------------------ -GET _search/template +GET _search/template?include_type_name=false { "source": { "query": { @@ -64,7 +64,7 @@ like maps and array to their JSON representation: [source,js] ------------------------------------------ -GET _search/template +GET _search/template?include_type_name=false { "source": "{ \"query\": { \"terms\": {{#toJson}}statuses{{/toJson}} }}", "params": { @@ -97,7 +97,7 @@ A more complex example substitutes an array of JSON objects: [source,js] ------------------------------------------ -GET _search/template +GET _search/template?include_type_name=false { "source": "{\"query\":{\"bool\":{\"must\": {{#toJson}}clauses{{/toJson}} }}}", "params": { diff --git a/docs/reference/search/search.asciidoc b/docs/reference/search/search.asciidoc index b8e3da976d616..4d4e221e56569 100644 --- a/docs/reference/search/search.asciidoc +++ b/docs/reference/search/search.asciidoc @@ -16,7 +16,7 @@ example, we can search on all documents within the twitter index: [source,js] -------------------------------------------------- -GET /twitter/_search?q=user:kimchy +GET /twitter/_search?q=user:kimchy&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] @@ -26,7 +26,7 @@ We can also search all tweets with a certain tag across several indices [source,js] -------------------------------------------------- -GET /kimchy,elasticsearch/_search?q=tag:wow +GET /kimchy,elasticsearch/_search?q=tag:wow&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[s/^/PUT kimchy\nPUT elasticsearch\n/] @@ -36,7 +36,7 @@ placeholder: [source,js] -------------------------------------------------- -GET /_all/_search?q=tag:wow +GET /_all/_search?q=tag:wow&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] @@ -45,7 +45,7 @@ Or even search across all indices and all types: [source,js] -------------------------------------------------- -GET /_search?q=tag:wow +GET /_search?q=tag:wow&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] diff --git a/docs/reference/search/suggesters.asciidoc b/docs/reference/search/suggesters.asciidoc index 248992a12e21e..275348b1d9d9e 100644 --- a/docs/reference/search/suggesters.asciidoc +++ b/docs/reference/search/suggesters.asciidoc @@ -14,7 +14,7 @@ suggest only search requests. [source,js] -------------------------------------------------- -POST twitter/_search +POST twitter/_search?include_type_name=false { "query" : { "match": { @@ -41,7 +41,7 @@ the `term` suggester, but have a different `text`. [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "suggest": { "my-suggest-1" : { @@ -117,7 +117,7 @@ and applies to the `my-suggest-1` and `my-suggest-2` suggestions. [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "suggest": { "text" : "tring out Elasticsearch", diff --git a/docs/reference/search/suggesters/completion-suggest.asciidoc b/docs/reference/search/suggesters/completion-suggest.asciidoc index c52f28bc7bea4..db6f02d6f9d69 100644 --- a/docs/reference/search/suggesters/completion-suggest.asciidoc +++ b/docs/reference/search/suggesters/completion-suggest.asciidoc @@ -24,17 +24,15 @@ which indexes the field values for fast completions. [source,js] -------------------------------------------------- -PUT music +PUT music?include_type_name=false { "mappings": { - "_doc" : { - "properties" : { - "suggest" : { - "type" : "completion" - }, - "title" : { - "type": "keyword" - } + "properties" : { + "suggest" : { + "type" : "completion" + }, + "title" : { + "type": "keyword" } } } @@ -86,7 +84,7 @@ the suggestions will be scored. Indexing a suggestion is as follows: [source,js] -------------------------------------------------- -PUT music/_doc/1?refresh +PUT music/_doc/1?refresh&include_type_name=false { "suggest" : { "input": [ "Nevermind", "Nirvana" ], @@ -112,7 +110,7 @@ You can index multiple suggestions for a document as follows: [source,js] -------------------------------------------------- -PUT music/_doc/1?refresh +PUT music/_doc/1?refresh&include_type_name=false { "suggest" : [ { @@ -134,7 +132,7 @@ a weight with suggestion(s) in the shorthand form. [source,js] -------------------------------------------------- -PUT music/_doc/1?refresh +PUT music/_doc/1?refresh&include_type_name=false { "suggest" : [ "Nevermind", "Nirvana" ] } @@ -152,7 +150,7 @@ documents once deleted are never shown. This request: [source,js] -------------------------------------------------- -POST music/_search?pretty +POST music/_search?pretty&include_type_name=false { "suggest": { "song-suggest" : { @@ -193,7 +191,6 @@ returns this response: "options" : [ { "text" : "Nirvana", "_index": "music", - "_type": "_doc", "_id": "1", "_score": 1.0, "_source": { @@ -222,7 +219,7 @@ filtering but using suggest on the `_search` endpoint does: [source,js] -------------------------------------------------- -POST music/_search +POST music/_search?include_type_name=false { "_source": "suggest", <1> "suggest": { @@ -269,7 +266,6 @@ Which should look like: "options" : [ { "text" : "Nirvana", "_index": "music", - "_type": "_doc", "_id": "1", "_score": 1.0, "_source": { @@ -310,7 +306,7 @@ When set, this option filters out documents with duplicate suggestions from the [source,js] -------------------------------------------------- -POST music/_search?pretty +POST music/_search?pretty&include_type_name=false { "suggest": { "song-suggest" : { @@ -336,7 +332,7 @@ you can have a typo in your search and still get results back. [source,js] -------------------------------------------------- -POST music/_search?pretty +POST music/_search?pretty&include_type_name=false { "suggest": { "song-suggest" : { @@ -395,7 +391,7 @@ you can express a prefix as a regular expression [source,js] -------------------------------------------------- -POST music/_search?pretty +POST music/_search?pretty&include_type_name=false { "suggest": { "song-suggest" : { diff --git a/docs/reference/search/suggesters/context-suggest.asciidoc b/docs/reference/search/suggesters/context-suggest.asciidoc index ab52097a4c504..98bb9ef5ec06b 100644 --- a/docs/reference/search/suggesters/context-suggest.asciidoc +++ b/docs/reference/search/suggesters/context-suggest.asciidoc @@ -21,53 +21,49 @@ field: [source,js] -------------------------------------------------- -PUT place +PUT place?include_type_name=false { "mappings": { - "_doc" : { - "properties" : { - "suggest" : { - "type" : "completion", - "contexts": [ - { <1> - "name": "place_type", - "type": "category" - }, - { <2> - "name": "location", - "type": "geo", - "precision": 4 - } - ] - } + "properties" : { + "suggest" : { + "type" : "completion", + "contexts": [ + { <1> + "name": "place_type", + "type": "category" + }, + { <2> + "name": "location", + "type": "geo", + "precision": 4 + } + ] } } } } -PUT place_path_category +PUT place_path_category?include_type_name=false { "mappings": { - "_doc" : { - "properties" : { - "suggest" : { - "type" : "completion", - "contexts": [ - { <3> - "name": "place_type", - "type": "category", - "path": "cat" - }, - { <4> - "name": "location", - "type": "geo", - "precision": 4, - "path": "loc" - } - ] - }, - "loc": { - "type": "geo_point" - } + "properties" : { + "suggest" : { + "type" : "completion", + "contexts": [ + { <3> + "name": "place_type", + "type": "category", + "path": "cat" + }, + { <4> + "name": "location", + "type": "geo", + "precision": 4, + "path": "loc" + } + ] + }, + "loc": { + "type": "geo_point" } } } @@ -100,7 +96,7 @@ be sent in the suggest field like this: [source,js] -------------------------------------------------- -PUT place/_doc/1 +PUT place/_doc/1?include_type_name=false { "suggest": { "input": ["timmy's", "starbucks", "dunkin donuts"], @@ -118,7 +114,7 @@ add the categories: [source,js] -------------------------------------------------- -PUT place_path_category/_doc/1 +PUT place_path_category/_doc/1?include_type_name=false { "suggest": ["timmy's", "starbucks", "dunkin donuts"], "cat": ["cafe", "food"] <1> @@ -140,7 +136,7 @@ filters suggestions by multiple categories: [source,js] -------------------------------------------------- -POST place/_search?pretty +POST place/_search?pretty&include_type_name=false { "suggest": { "place_suggestion" : { @@ -169,7 +165,7 @@ suggestions associated with some categories: [source,js] -------------------------------------------------- -POST place/_search?pretty +POST place/_search?pretty&include_type_name=false { "suggest": { "place_suggestion" : { @@ -254,7 +250,7 @@ with two geo location contexts: [source,js] -------------------------------------------------- -PUT place/_doc/1 +PUT place/_doc/1?include_type_name=false { "suggest": { "input": "timmy's", @@ -284,7 +280,7 @@ the encoded geohash of a geo point: [source,js] -------------------------------------------------- -POST place/_search +POST place/_search?include_type_name=false { "suggest": { "place_suggestion" : { @@ -318,7 +314,7 @@ than others, as shown by the following: [source,js] -------------------------------------------------- -POST place/_search?pretty +POST place/_search?pretty&include_type_name=false { "suggest": { "place_suggestion" : { diff --git a/docs/reference/search/suggesters/misc.asciidoc b/docs/reference/search/suggesters/misc.asciidoc index 6866df24c0960..7a94153a642b4 100644 --- a/docs/reference/search/suggesters/misc.asciidoc +++ b/docs/reference/search/suggesters/misc.asciidoc @@ -8,7 +8,7 @@ Considering the following example with two suggesters `term` and `phrase`: [source,js] -------------------------------------------------- -POST _search?typed_keys +POST _search?typed_keys&include_type_name=false { "suggest": { "text" : "some test mssage", diff --git a/docs/reference/search/suggesters/phrase-suggest.asciidoc b/docs/reference/search/suggesters/phrase-suggest.asciidoc index 96d60467d1072..0614d46e36dff 100644 --- a/docs/reference/search/suggesters/phrase-suggest.asciidoc +++ b/docs/reference/search/suggesters/phrase-suggest.asciidoc @@ -84,7 +84,7 @@ suggester in the same spot you'd use the `term` suggester: [source,js] -------------------------------------------------- -POST test/_search +POST test/_search?include_type_name=false { "suggest": { "text": "noble prize", @@ -226,7 +226,7 @@ The response contains suggestions scored by the most likely spell correction fir [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "suggest": { "text" : "noble prize", @@ -392,7 +392,7 @@ accept ordinary analyzer names. [source,js] -------------------------------------------------- -POST _search +POST _search?include_type_name=false { "suggest": { "text" : "obel prize", diff --git a/docs/reference/search/uri-request.asciidoc b/docs/reference/search/uri-request.asciidoc index 279bc0c0384c1..fdf3228aa6c88 100644 --- a/docs/reference/search/uri-request.asciidoc +++ b/docs/reference/search/uri-request.asciidoc @@ -8,7 +8,7 @@ example: [source,js] -------------------------------------------------- -GET twitter/_search?q=user:kimchy +GET twitter/_search?q=user:kimchy&include_type_name=false -------------------------------------------------- // CONSOLE // TEST[setup:twitter] @@ -32,7 +32,6 @@ And here is a sample response: "hits" : [ { "_index" : "twitter", - "_type" : "_doc", "_id" : "0", "_score": 1.3862944, "_source" : {