Skip to content

Instantly share code, notes, and snippets.

@stratawing
Created March 12, 2012 02:43
Show Gist options
  • Save stratawing/2019391 to your computer and use it in GitHub Desktop.
Save stratawing/2019391 to your computer and use it in GitHub Desktop.
ES question
# mappings and analyzer below
curl -XPUT http://localhost:9200/cerberus -d '{
"mappings" : {
"rawcrit" : {
"properties" : {
....snip....
"std_par":{"type" : "string", "index_analyzer":"std_par"}
}
}
},
"settings" : {
"analysis" : {
"filter" : {
"std_par_filt" : {
"type" : "synonym",
"synonyms_path" : "analysis/std_par_filt.txt"
},
.... snip...
},
"analyzer" : {
"std_par" : {
"tokenizer" : "keyword",
"filter" : ["std_par_filt"]
...snip...
# synonyms file below
std_par_filt.txt:
lead, pb, D008 => ID_1001
...snip...
#desired ouput would return ID_1001 if any of "lead", "pb", or "D008" are searched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment