Search in sources :

Example 1 with LuceneIndexExistsException

use of org.apache.geode.cache.lucene.LuceneIndexExistsException in project geode by apache.

the class LuceneIndexCreation method beforeCreate.

@Override
public void beforeCreate(Extensible<Region<?, ?>> source, Cache cache) {
    LuceneServiceImpl service = (LuceneServiceImpl) LuceneServiceProvider.get(cache);
    Analyzer analyzer = this.fieldAnalyzers == null ? new StandardAnalyzer() : new PerFieldAnalyzerWrapper(new StandardAnalyzer(), this.fieldAnalyzers);
    try {
        service.createIndex(getName(), getRegionPath(), analyzer, this.fieldAnalyzers, getFieldNames());
    } catch (LuceneIndexExistsException e) {
        logger.info(LocalizedStrings.LuceneIndexCreation_IGNORING_DUPLICATE_INDEX_CREATION_0_ON_REGION_1.toLocalizedString(e.getIndexName(), e.getRegionPath()));
    }
}
Also used : LuceneIndexExistsException(org.apache.geode.cache.lucene.LuceneIndexExistsException) StandardAnalyzer(org.apache.lucene.analysis.standard.StandardAnalyzer) LuceneServiceImpl(org.apache.geode.cache.lucene.internal.LuceneServiceImpl) Analyzer(org.apache.lucene.analysis.Analyzer) StandardAnalyzer(org.apache.lucene.analysis.standard.StandardAnalyzer) PerFieldAnalyzerWrapper(org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper)

Aggregations

LuceneIndexExistsException (org.apache.geode.cache.lucene.LuceneIndexExistsException)1 LuceneServiceImpl (org.apache.geode.cache.lucene.internal.LuceneServiceImpl)1 Analyzer (org.apache.lucene.analysis.Analyzer)1 PerFieldAnalyzerWrapper (org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper)1 StandardAnalyzer (org.apache.lucene.analysis.standard.StandardAnalyzer)1