-
-
Save jamesgorrie/a1f7de9fa2fe910fc6bc206a1c6dd365 to your computer and use it in GitHub Desktop.
This file contains 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
PUT test | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"standard_shingle": { | |
"tokenizer": "standard", | |
"filter": [ "shingle" ] | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"properties": { | |
"title": { | |
"type": "text", | |
"fields": { | |
"shingle": { | |
"type": "text", | |
"analyzer": "standard_shingle" | |
} | |
} | |
} | |
} | |
} | |
} | |
GET test/_search | |
{ | |
"query": { | |
"fuzzy": { | |
"title.shingle": { | |
"value": "text books" | |
} | |
} | |
} | |
} | |
GET test/_search | |
{ | |
"query": { | |
"fuzzy": { | |
"title.shingle": { | |
"value": "textbooks" | |
} | |
} | |
} | |
} | |
GET test/_search | |
{ | |
"query": { | |
"multi_match": { | |
"fields": ["title.shingle"], | |
"query": "text books", | |
"fuzziness": "auto" | |
} | |
} | |
} | |
GET test/_search | |
{ | |
"query": { | |
"multi_match": { | |
"fields": ["title.shingle"], | |
"query": "textbooks", | |
"fuzziness": "auto" | |
} | |
} | |
} | |
PUT test/_doc/1 | |
{ | |
"title": "textbooks" | |
} | |
PUT test/_doc/2 | |
{ | |
"title": "text books" | |
} | |
PUT test/_doc/3 | |
{ | |
"title": "textabooks" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment