: I want a want a way to get total term count per document. I am using This isn't a stat that Lucene (or solr) tracks per document ... you could probably add this as a custom plugin, but it would be somewhat tricky to implement (you'd need to take advantage of the TeeTOkenFilter and SinkTokenizer, and then register a TeeTokenFilter at the end of every analyzer, and use your Sink to count the number of tokens and use it as a value in a different field ... but even that would only know about the TextFields, and you wouldn't get the ocunt of Terms that come from numeric/boolean fields)
Can you explain what it is you're trying to do with this information... http://people.apache.org/~hossman/#xyproblem XY Problem Your question appears to be an "XY Problem" ... that is: you are dealing with "X", you are assuming "Y" will help you, and you are asking about "Y" without giving more details about the "X" so that we can understand the full issue. Perhaps the best solution doesn't involve "Y" at all? See Also: http://www.perlmonks.org/index.pl?node_id=542341 -Hoss