Skip to content

Instantly share code, notes, and snippets.

@nik9000
Created December 30, 2016 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nik9000/2132cee6ae280b8c56b473aa6685ab08 to your computer and use it in GitHub Desktop.
Save nik9000/2132cee6ae280b8c56b473aa6685ab08 to your computer and use it in GitHub Desktop.
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