I want to find the count of those elements within this document that have topic as "xyz". Is this possible using elastic search aggregation or does it work only with multiple documents.
I am not 100% sure what you mean. If you want to query all documents with the topic xyz you should set the topic as a keyword and use a terms query. It will give you back all your documents with xyz.
Will this terms query or any other elastic search aggregation look for values within 1 document? If 1 document itself has topic xyz mentioned 10 times, will it count that as 10 ?
Aggregations work across documents, not within them.
You will probably need to split your documents out so that you have one for each topic for a given time range. So in your last example, you'd actually have 3 documents, that you'd then aggregate across/
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.