OpenSearch/rest-api-spec/test/indices.analyze/10_analyze.yaml

45 lines
971 B
YAML
Raw Normal View History

2013-06-22 12:57:29 -04:00
---
"Basic test":
2013-06-22 12:57:29 -04:00
- do:
indices.analyze:
text: Foo Bar
- length: { tokens: 2 }
- match: { tokens.0.token: foo }
- match: { tokens.1.token: bar }
2013-06-22 12:57:29 -04:00
---
"Tokenizer and filter":
2013-06-22 12:57:29 -04:00
- do:
indices.analyze:
filters: lowercase
text: Foo Bar
tokenizer: keyword
- length: { tokens: 1 }
- match: { tokens.0.token: foo bar }
2013-06-22 12:57:29 -04:00
---
"Index and field":
- do:
indices.create:
index: test
body:
mappings:
test:
properties:
text:
type: string
analyzer: whitespace
- do:
cluster.health:
wait_for_status: yellow
2013-06-22 12:57:29 -04:00
- do:
indices.analyze:
field: text
index: test
text: Foo Bar!
- length: { tokens: 2 }
- match: { tokens.0.token: Foo }
- match: { tokens.1.token: Bar! }