Skip to content

Commit

Permalink
add two yml test file
Browse files Browse the repository at this point in the history
  • Loading branch information
boliza committed Jan 17, 2018
1 parent 6c02534 commit caf3c11
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/resources/rest-api-spec/test/analysis-hanlp/10_basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"Tokenizer":
- do:
indices.analyze:
body:
text: 我购买了道具和服装。
tokenizer: hanlp
- length: { tokens: 3 }
- match: { tokens.0.token: 购买 }
- match: { tokens.1.token: 道具 }
- match: { tokens.2.token: 服装 }
---
"Analyzer":
- do:
indices.analyze:
body:
text: 我购买了道具和服装。
analyzer: hanlp-index
- length: { tokens: 3 }
- match: { tokens.0.token: 购买 }
- match: { tokens.1.token: 道具 }
- match: { tokens.2.token: 服装 }
30 changes: 30 additions & 0 deletions src/test/resources/rest-api-spec/test/analysis-hanlp/20_search.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
"Index Hanlp content":
- do:
indices.create:
index: test
body:
mappings:
type:
properties:
text:
type: text
analyzer: hanlp

- do:
index:
index: test
type: type
id: 1
body: { "text": "我购买了道具和服装" }
- do:
indices.refresh: {}

- do:
search:
index: test
body:
query:
match:
text: 购买
- match: { hits.total: 1 }

0 comments on commit caf3c11

Please sign in to comment.