Created
March 12, 2012 02:43
-
-
Save stratawing/2019391 to your computer and use it in GitHub Desktop.
ES question
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
# 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