Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
index_people_with_routing
# Delete the `people` index
DELETE /people
# Create the `people` index with proper settings
PUT /people
{
"settings": {
"analysis": {
"filter": {
"brazilian_stop": {
"type": "stop",
"stopwords": "_brazilian_"
},
"brazilian_stemmer": {
"type": "stemmer",
"language": "brazilian"
}
},
"analyzer": {
"brazilian": {
"tokenizer": "standard",
"filter": [
"lowercase",
"brazilian_stop",
"brazilian_stemmer"
]
}
}
}
},
"mappings": {
"person": {
"_routing": {
"required": true,
"path": "accountId"
},
"properties": {
"accountId": {
"type": "string",
"index" : "not_analyzed"
},
"imageUrl": {
"type": "string",
"index" : "not_analyzed"
},
"title": {
"type": "string",
"index" : "not_analyzed"
},
"createdAt": {
"type": "date",
"index" : "not_analyzed"
},
"firstName": {
"type": "multi_field",
"fields": {
"firstName": {
"type": "string",
"analyzer":"brazilian"
},
"untouched": {
"type": "string",
"index" : "not_analyzed"
}
}
},
"lastName": {
"type": "multi_field",
"fields": {
"lastName": {
"type": "string",
"analyzer":"brazilian"
},
"untouched": {
"type": "string",
"index" : "not_analyzed"
}
}
},
"tags": {
"type": "string"
},
"emails":{
"type": "multi_field",
"fields": {
"email": {
"type": "string",
"index" : "analyzed",
"analyzer": "simple"
},
"untouched":{
"type": "string",
"index" : "not_analyzed"
}
}
},
"phones":{
"type": "multi_field",
"fields": {
"phones": {
"type": "string",
"index" : "analyzed",
"analyzer": "whitespace"
},
"untouched":{
"type": "string",
"index" : "not_analyzed"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.