see on GitHub

Commands: Indexes: How to get index terms?

GetTerms will retrieve all stored terms for a field of an index.

Syntax

public List<String> getTerms(String index, String field, String fromValue, int pageSize);

Parameters
index String Name of an index
field String Index field
fromValue String Starting point for a query, used for paging
pageSize int Maximum number of terms that will be returned
Return Value
String[] Array of index terms.

Example

store.getDatabaseCommands().getTerms("Orders/Totals", "Company", null, 128);