Docs: revise examples

(cherry picked from commit 14ac3b0)
This commit is contained in:
Jun Ohtani 2014-12-19 16:25:51 +09:00
parent 6a19e38f68
commit 5ced1949d6
1 changed files with 150 additions and 67 deletions

View File

@ -127,9 +127,12 @@ User Dictionary file is placed `ES_HOME/config` directory.
### example ### example
_Example Settings:_
```sh ```sh
curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d' curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
{ {
"settings": {
"index":{ "index":{
"analysis":{ "analysis":{
"tokenizer" : { "tokenizer" : {
@ -150,9 +153,19 @@ curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
} }
} }
} }
}
' '
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d '東京スカイツリー' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d '東京スカイツリー'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "東京", "token" : "東京",
@ -177,9 +190,12 @@ This acts as a lemmatizer for verbs and adjectives.
### example ### example
_Example Settings:_
```sh ```sh
curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d' curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
{ {
"settings": {
"index":{ "index":{
"analysis":{ "analysis":{
"analyzer" : { "analyzer" : {
@ -191,9 +207,19 @@ curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
} }
} }
} }
}
' '
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d '飲み' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d '飲み'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "飲む", "token" : "飲む",
@ -219,9 +245,12 @@ Note that default setting is stoptags.txt include lucene-analyzer-kuromoji.jar.
### example ### example
_Example Settings:_
```sh ```sh
curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d' curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
{ {
"settings": {
"index":{ "index":{
"analysis":{ "analysis":{
"analyzer" : { "analyzer" : {
@ -242,9 +271,19 @@ curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
} }
} }
} }
}
' '
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d '寿司がおいしいね' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d '寿司がおいしいね'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "寿司", "token" : "寿司",
@ -277,9 +316,12 @@ Note that elasticsearch-analysis-kuromoji built-in `kuromoji_readingform` set de
### example ### example
_Example Settings:_
```sh ```sh
curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d' curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
{ {
"settings": {
"index":{ "index":{
"analysis":{ "analysis":{
"analyzer" : { "analyzer" : {
@ -305,9 +347,19 @@ curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
} }
} }
} }
}
' '
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=katakana_analyzer&pretty' -d '寿司' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=katakana_analyzer&pretty' -d '寿司'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "スシ", "token" : "スシ",
@ -317,8 +369,17 @@ curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=katakana_an
"position" : 1 "position" : 1
} ] } ]
} }
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=romaji_analyzer&pretty' -d '寿司' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=romaji_analyzer&pretty' -d '寿司'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "sushi", "token" : "sushi",
@ -345,9 +406,12 @@ The following are settings that can be set for a `kuromoji_stemmer` token filter
### example ### example
_Example Settings:_
```sh ```sh
curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d' curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
{ {
"settings": {
"index":{ "index":{
"analysis":{ "analysis":{
"analyzer" : { "analyzer" : {
@ -365,9 +429,19 @@ curl -XPUT 'http://localhost:9200/kuromoji_sample/' -d'
} }
} }
} }
}
' '
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d 'コピー' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d 'コピー'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "コピー", "token" : "コピー",
@ -377,8 +451,17 @@ curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer
"position" : 1 "position" : 1
} ] } ]
} }
```
_Example Request using `_analyze` API :_
```sh
curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d 'サーバー' curl -XPOST 'http://localhost:9200/kuromoji_sample/_analyze?analyzer=my_analyzer&pretty' -d 'サーバー'
```
_Response :_
```json
{ {
"tokens" : [ { "tokens" : [ {
"token" : "サーバ", "token" : "サーバ",