Created
February 13, 2013 09:19
-
-
Save martijnvg/4943265 to your computer and use it in GitHub Desktop.
Term facet with a pattern analyzed field
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 -s -XPUT localhost:9200/_template/template_tags -d '{ | |
"template" : "tags*", | |
"settings" : { | |
"index.analysis.analyzer.csv.type" : "pattern", | |
"index.analysis.analyzer.csv.pattern" : "," | |
}, | |
"mappings" : { | |
"_default_" : { | |
"properties" : { | |
"tags" : { | |
"type" : "string", | |
"analyzer" : "csv", | |
"store" : "yes" | |
} | |
} | |
} | |
} | |
}' | |
echo | |
curl -s -XPUT 'localhost:9200/tags' | |
echo | |
curl -s -XPUT 'localhost:9200/tags/tag/1' -d '{ | |
"tags" : "a-b,a-b,a-c" | |
}' | |
curl -s -XPOST 'localhost:9200/_refresh' | |
echo | |
curl -s -XPOST 'localhost:9200/tags/_search' -d '{ | |
"facets" : { | |
"tags" : { | |
"terms" : { | |
"field" : "tags" | |
} | |
} | |
} | |
}' | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment