Solr’s New AnalyticsQuery API by Joel Bernstein.
From the post:
In Solr 4.9 there is a new AnalyticsQuery API that allows developers to plug custom analytic logic into Solr. The AnalyticsQuery class provides a clean and simple API that gives developers access to all the rich functionality in Lucene and is strategically placed within Solr’s distributed search architecture. Using this API you can harness all the power of Lucene and Solr to write custom analytic logic.
Not all the detail you are going to want but a good start towards using the new AnalyticsQuery API in Solr 4.9.
The AnalyticsQuery API is an example of why I wonder about projects with custom search solutions (read not Lucene-based).
If you have any doubts, default to a Lucene-based search solution.