Created
June 24, 2019 18:47
-
-
Save matthuhiggins/b5139bfade363744dbad942e2b44f90d 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
curl -X DELETE "localhost:9200/companies" | |
curl -X PUT "localhost:9200/companies" -H 'Content-Type: application/json' -d' | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"company_name_analyzer": { | |
"type": "custom", | |
"tokenizer": "standard", | |
"filter": ["company_name_filter"] | |
} | |
}, | |
"filter": { | |
"company_name_filter": { | |
"type": "multiplexer", | |
"filters": [ | |
"company_name_camel_case, lowercase", | |
"lowercase, company_name_abbreviations" | |
] | |
}, | |
"company_name_abbreviations": { | |
"type": "synonym_graph", | |
"synonyms": ["co-op => cooperative", "corp,corporation"] | |
}, | |
"company_name_camel_case": { | |
"type": "word_delimiter_graph" | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"company_name": {"type": "text", "analyzer": "company_name_analyzer"} | |
} | |
} | |
} | |
}' | |
curl -X PUT "localhost:9200/companies/_doc/1" -H 'Content-Type: application/json' -d' | |
{ | |
"company_name" : "FedEx" | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On ES 6.8, this outputs: