Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move analysis/mappings stats to cluster-stats. #51260

Merged
merged 6 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
"get cluster stats returns analysis stats":

- skip:
version: " - 7.99.99" # TODO: 7.6.99
reason: "analysis stats are added for v7.7.0"

- do:
cluster.stats: {}

- length: { indices.analysis.char_filter_types: 0 }
- length: { indices.analysis.tokenizer_types: 0 }
- length: { indices.analysis.filter_types: 0 }
- length: { indices.analysis.analyzer_types: 0 }

- length: { indices.analysis.built_in_char_filters: 0 }
- length: { indices.analysis.built_in_tokenizers: 0 }
- length: { indices.analysis.built_in_filters: 0 }
- length: { indices.analysis.built_in_analyzers: 0 }

- do:
indices.create:
index: test-index1
body:
settings:
analysis:
char_filter:
c:
type: mapping
mappings: [ "a => b" ]
tokenizer:
tok:
type: pattern
pattern: ","
filter:
st:
type: stop
stopwords: [ "a" ]
st2:
type: stop
stopwords: [ "b" ]
analyzer:
en:
type: standard
stopwords: "_english_"
cust:
char_filter: [ "html_strip" ]
tokenizer: "keyword"
filter: [ "trim" ]
mappings:
properties:
message:
type: "text"
analyzer: french
search_analyzer: spanish
search_quote_analyzer: german
description:
type: "text"
analyzer: french

- do:
indices.create:
index: test-index2
body:
mappings:
properties:
message:
type: "text"
analyzer: spanish

- do:
cluster.stats: {}

- length: { indices.analysis.char_filter_types: 1 }
- match: { indices.analysis.char_filter_types.0.name: mapping }
- match: { indices.analysis.char_filter_types.0.count: 1 }
- match: { indices.analysis.char_filter_types.0.index_count: 1 }

- length: { indices.analysis.tokenizer_types: 1 }
- match: { indices.analysis.tokenizer_types.0.name: pattern }
- match: { indices.analysis.tokenizer_types.0.count: 1 }
- match: { indices.analysis.tokenizer_types.0.index_count: 1 }

- length: { indices.analysis.filter_types: 1 }
- match: { indices.analysis.filter_types.0.name: stop }
- match: { indices.analysis.filter_types.0.count: 2 }
- match: { indices.analysis.filter_types.0.index_count: 1 }

- length: { indices.analysis.analyzer_types: 2 }
- match: { indices.analysis.analyzer_types.0.name: custom }
- match: { indices.analysis.analyzer_types.0.count: 1 }
- match: { indices.analysis.analyzer_types.0.index_count: 1 }
- match: { indices.analysis.analyzer_types.1.name: standard }
- match: { indices.analysis.analyzer_types.1.count: 1 }
- match: { indices.analysis.analyzer_types.1.index_count: 1 }

- length: { indices.analysis.built_in_char_filters: 1 }
- match: { indices.analysis.built_in_char_filters.0.name: html_strip }
- match: { indices.analysis.built_in_char_filters.0.count: 1 }
- match: { indices.analysis.built_in_char_filters.0.index_count: 1 }

- length: { indices.analysis.built_in_tokenizers: 1 }
- match: { indices.analysis.built_in_tokenizers.0.name: keyword }
- match: { indices.analysis.built_in_tokenizers.0.count: 1 }
- match: { indices.analysis.built_in_tokenizers.0.index_count: 1 }

- length: { indices.analysis.built_in_filters: 1 }
- match: { indices.analysis.built_in_filters.0.name: trim }
- match: { indices.analysis.built_in_filters.0.count: 1 }
- match: { indices.analysis.built_in_filters.0.index_count: 1 }

- length: { indices.analysis.built_in_analyzers: 3 }
- match: { indices.analysis.built_in_analyzers.0.name: french }
- match: { indices.analysis.built_in_analyzers.0.count: 2 }
- match: { indices.analysis.built_in_analyzers.0.index_count: 1 }
- match: { indices.analysis.built_in_analyzers.1.name: german }
- match: { indices.analysis.built_in_analyzers.1.count: 1 }
- match: { indices.analysis.built_in_analyzers.1.index_count: 1 }
- match: { indices.analysis.built_in_analyzers.2.name: spanish }
- match: { indices.analysis.built_in_analyzers.2.count: 2 }
- match: { indices.analysis.built_in_analyzers.2.index_count: 2 }

Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,57 @@
cluster.stats: {}

- is_true: nodes.packaging_types

---
"get cluster stats returns mapping stats":

- skip:
version: " - 7.99.99" # TODO: 7.6.99
reason: "mapping stats are added for v7.7.0"

- do:
cluster.stats: {}

- length: { indices.mappings.field_types: 0 }

- do:
indices.create:
index: test-index1
body:
mappings:
properties:
foo:
type: keyword

- do:
indices.create:
index: test-index2
body:
mappings:
properties:
foo:
type: keyword
bar:
properties:
quux:
type: integer
baz:
type: keyword

- do:
cluster.stats: {}

- length: { indices.mappings.field_types: 3 }

- match: { indices.mappings.field_types.0.name: integer }
- match: { indices.mappings.field_types.0.count: 1 }
- match: { indices.mappings.field_types.0.index_count: 1 }

- match: { indices.mappings.field_types.1.name: keyword }
- match: { indices.mappings.field_types.1.count: 3 }
- match: { indices.mappings.field_types.1.index_count: 2 }

- match: { indices.mappings.field_types.2.name: object }
- match: { indices.mappings.field_types.2.count: 1 }
- match: { indices.mappings.field_types.2.index_count: 1 }

Loading