/** * Create a new Instance of LuceneSingleIndexLocation. This is the Default IndexLocation for * Lucene. * * @param config configuration */ public LuceneSingleIndexLocation(final CRConfig config) { super(config); indexLocation = getFirstIndexLocation(config); dir = createDirectory(indexLocation, config); // Create index accessor IndexAccessorFactory iAFactory = IndexAccessorFactory.getInstance(); if (!iAFactory.hasAccessor(dir)) { try { iAFactory.createAccessor(dir, getConfiguredAnalyzer()); } catch (IOException ex) { log.fatal("COULD NOT CREATE INDEX ACCESSOR" + ex.getMessage()); } } else { log.debug("Accessor already present."); } // check if facets are activated and create a TaxonomyAccessor if necessary useFacets = config.getBoolean(FACET_FLAG_KEY, useFacets); if (useFacets) { log.debug("Facets are active"); taxonomyLocation = retrieveTaxonomyLocation(config); taxonomyDir = createDirectory(taxonomyLocation, config); TaxonomyAccessorFactory taFactory = TaxonomyAccessorFactory.getInstance(); if (!taFactory.hasAccessor(taxonomyDir)) { try { taFactory.createAccessor(config, taxonomyDir); } catch (IOException e) { log.fatal("COULD NOT CREATE TAXONOMY ACCESSOR" + e.getMessage()); } } else { log.debug("TaxonomyAccessor already present."); } } else { log.debug("Facets are not active"); } }