Last active
August 31, 2015 14:03
-
-
Save lfreneda/74bfc68439144899d256 to your computer and use it in GitHub Desktop.
index_people_with_routing
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 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