IndexConfig[] configArr = SearchToolkit.getIndexConfigArr(request);
String[] fieldValues;
if (configArr.length == 1) {
// We have only one index -> Get the field values
IndexConfig config = configArr[0];
IndexSearcherManager manager = IndexSearcherManager.getInstance(config.getDirectory());
fieldValues = manager.getFieldValues(fieldName);
} else {
// We have multiple indexes -> Get the values of each index and merge them
HashSet valueSet = new HashSet();
for (int i = 0; i < configArr.length; i++) {
IndexSearcherManager manager = IndexSearcherManager.getInstance(configArr[i].getDirectory());
String[] currFieldValues = manager.getFieldValues(fieldName);
for (int j = 0; j < currFieldValues.length; j++) {
valueSet.add(currFieldValues[j]);
}
}