* @param field - the name of the command or null for all of them.
*/
public void terms(String field) throws IOException {
TreeMap<String,Integer> termMap = new TreeMap<String,Integer>();
IndexReader indexReader = IndexReader.open(indexName, true);
TermEnum terms = indexReader.terms();
while (terms.next()) {
Term term = terms.term();
//message(term.field() + ":" + term.text() + " freq:" + terms.docFreq());
//if we're either not looking by field or we're matching the specific field
if ((field == null) || field.equals(term.field()))