Skip to content

Instantly share code, notes, and snippets.

@gibrown
Created January 10, 2012 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gibrown/1586723 to your computer and use it in GitHub Desktop.
Save gibrown/1586723 to your computer and use it in GitHub Desktop.
Profiling queries for building word clouds
#word histogram query - docs for separate ids in separate types
curl -XGET "${SERVER}/pd-0/${ID}/_search?pretty" \
-d '{
"size" : 0,
"query" : { "match_all" : { } },
"facets" : {
"q1" : {
"terms" : {
"field" : "q1",
"size" : 100
}
}
}
}'
#word histogram query - all docs in same index - faceted_filter
curl -XGET "${SERVER}/pd-test-0/word_cloud/_search?pretty" \
-d "{
\"size\" : 0,
\"facets\" : {
\"q1\" : {
\"terms\" : {
\"field\" : \"q1\",
\"size\" : 100
},
\"facet_filter\" : {
\"term\" : { \"pd_id\" : \"$ID\" }
}
}
}
}"
#word histogram query - all docs in same index - query 'filter' of docs
curl -XGET "${SERVER}/pd-test-0/word_cloud/_search?pretty" \
-d "{
\"size\" : 0,
\"query\" : {
\"term\" : { \"pd_id\" : \"$ID\" }
},
\"facets\" : {
\"q1\" : {
\"terms\" : {
\"field\" : \"q1\",
\"size\" : 100
}
}
}
}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment