}//TESTED
RAMDirectory idx = new RAMDirectory();
try {
CrossVersionIndexWriter writer = new CrossVersionIndexWriter(idx, Version.LUCENE_30, new StandardAnalyzer(Version.LUCENE_30));
int nAdded = 0;
indexToSearchCacheIndexes = new EntityFeaturePojo[aliasTable.masters().size()];
for (EntityFeaturePojo alias: aliasTable.masters()) {
if ((null != alias.getIndex()) && (null != alias.getDisambiguatedName()) && (null != alias.getAlias())
&& !alias.getIndex().equalsIgnoreCase("discard") && !alias.getAlias().contains(alias.getIndex()))
{
// (that last check just means there's no point in including the alias if it has itself as a sub-alias)
writer.addSingleAnalyzedUnstoredFieldDocument("name", alias.getDisambiguatedName());
indexToSearchCacheIndexes[nAdded] = alias;
nAdded++;
//System.out.println("CACHE ADD: " + alias.getDisambiguatedName() + ": " + nAdded + " - " + alias.getIndex());
}
}
writer.close();
if (nAdded > 0) {
if (null != _aliasSearcherCache) {
try {
_aliasSearcherCache.getIndexReader().close();