Created
December 30, 2016 20:50
-
-
Save nik9000/2132cee6ae280b8c56b473aa6685ab08 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
DELETE test | |
PUT test | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"pluralwordsAnalyzer": { | |
"type": "snowball", | |
"language": "English" | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"test": { | |
"properties": { | |
"shortDescription": { | |
"type": "text", | |
"fields": { | |
"plural": { | |
"type": "text", | |
"analyzer": "pluralwordsAnalyzer", | |
"search_analyzer": "pluralwordsAnalyzer" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
PUT test/test/1?refresh | |
{ | |
"shortDescription": "apple" | |
} | |
PUT test/test/2?refresh | |
{ | |
"shortDescription": "apples" | |
} | |
POST test/_search | |
{ | |
"query": { | |
"match": { | |
"shortDescription.plural": { | |
"query": "apple", | |
"minimum_should_match": 1 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment