Created
May 5, 2012 17:13
-
-
Save anjesh/2604121 to your computer and use it in GitHub Desktop.
Facet with phrases, allows counts for phrases with spaces
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 -XDELETE http://localhost:9200/testcompany/ | |
curl -XPUT 'http://localhost:9200/testcompany/' | |
curl -XPUT 'http://localhost:9200/testcompany/activity1/_mapping' -d '{ | |
"activity" : { | |
"properties" : { | |
"organization" : {"analyzer": "keyword", "type": "string"} | |
} | |
} | |
}' | |
curl -XPUT http://localhost:9200/testcompany/activity1/1 -d '{ | |
"title": "title1 of project", | |
"organization": "ABC company" | |
}' | |
curl -XPUT http://localhost:9200/testcompany/activity1/2 -d '{ | |
"title": "title2 of project", | |
"organization": "XYZ company" | |
}' | |
curl -XPUT http://localhost:9200/testcompany/activity1/3 -d '{ | |
"title": "title3 of project", | |
"organization": "XYZ company" | |
}' | |
curl -X POST http://localhost:9200/testcompany/activity1/_search?pretty=true -d '{ | |
"query" : {"match_all":{}}, | |
"facets" : {"organization" : {"terms" : {"field": "organization"}}} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment