Last active
September 22, 2017 03:14
-
-
Save TomonoriSoejima/300ea259bd31be66d57625be2823e885 to your computer and use it in GitHub Desktop.
kuromoji with phrase test on 5.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET _cat/plugins/ | |
# settings | |
PUT /kuro/ | |
{ | |
"settings": { | |
"index":{ | |
"analysis":{ | |
"analyzer" : { | |
"my_analyzer" : { | |
"tokenizer" : "kuromoji_tokenizer", | |
"filter" : ["kuromoji_baseform"] | |
} | |
} | |
} | |
} | |
} | |
} | |
POST kuro/_analyze | |
{ | |
"analyzer": "my_analyzer", | |
"text": "紅茶を飲む" | |
} | |
PUT kuro/doc/1 | |
{ | |
"title": "紅茶飲む" | |
} | |
PUT kuro/doc/2 | |
{ | |
"title": "紅茶にミルクを入れる" | |
} | |
PUT kuro/doc/3 | |
{ | |
"title": "紅茶に沖縄県から届いたミルクを入れる" | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"operator": "and", | |
"query": "紅茶飲む" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "紅茶にミルク" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "紅茶がミルク" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "紅茶 ミルク" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "紅茶にはミルク" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"operator": "or", | |
"query": "紅茶がミルク", | |
"type" : "phrase" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"operator": "or", | |
"query": "紅茶 ミルク", | |
"type" : "phrase" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"operator": "or", | |
"query": "紅茶にはミルク", | |
"type" : "phrase" | |
} | |
} | |
} | |
} | |
GET /kuro/_search | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "紅茶 ミルク", | |
"type" : "phrase", | |
"slop" : 10 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment