This might be a basic question but I've looked around and haven't found my answer.
How do I go about creating a visualization (say a pie chart with count aggregation, split slices with a range aggregation, etc) but I'm only interested in the documents that are subject to the results of say a term query?
I see there's a box for Lucene code and also under 'advanced', it takes JSON input but I'm not sure how to use it.
Any help would be appreciated.


