Search in sources :

Example 1 with BlockTreeOrdsPostingsFormat

use of org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat in project neo4j by neo4j.

the class IndexWriterConfigs method standard.

public static IndexWriterConfig standard() {
    IndexWriterConfig writerConfig = new IndexWriterConfig(LuceneDataSource.KEYWORD_ANALYZER);
    writerConfig.setMaxBufferedDocs(MAX_BUFFERED_DOCS);
    writerConfig.setMaxBufferedDeleteTerms(MAX_BUFFERED_DELETE_TERMS);
    writerConfig.setIndexDeletionPolicy(new MultipleBackupDeletionPolicy());
    writerConfig.setUseCompoundFile(true);
    writerConfig.setRAMBufferSizeMB(STANDARD_RAM_BUFFER_SIZE_MB);
    writerConfig.setCodec(new Lucene54Codec() {

        @Override
        public PostingsFormat getPostingsFormatForField(String field) {
            PostingsFormat postingFormat = super.getPostingsFormatForField(field);
            return CODEC_BLOCK_TREE_ORDS_POSTING_FORMAT ? blockTreeOrdsPostingsFormat : postingFormat;
        }
    });
    LogByteSizeMergePolicy mergePolicy = new LogByteSizeMergePolicy();
    mergePolicy.setNoCFSRatio(MERGE_POLICY_NO_CFS_RATIO);
    mergePolicy.setMinMergeMB(MERGE_POLICY_MIN_MERGE_MB);
    mergePolicy.setMergeFactor(MERGE_POLICY_MERGE_FACTOR);
    writerConfig.setMergePolicy(mergePolicy);
    return writerConfig;
}
Also used : MultipleBackupDeletionPolicy(org.neo4j.index.impl.lucene.legacy.MultipleBackupDeletionPolicy) LogByteSizeMergePolicy(org.apache.lucene.index.LogByteSizeMergePolicy) BlockTreeOrdsPostingsFormat(org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat) PostingsFormat(org.apache.lucene.codecs.PostingsFormat) IndexWriterConfig(org.apache.lucene.index.IndexWriterConfig) Lucene54Codec(org.apache.lucene.codecs.lucene54.Lucene54Codec)

Aggregations

PostingsFormat (org.apache.lucene.codecs.PostingsFormat)1 BlockTreeOrdsPostingsFormat (org.apache.lucene.codecs.blocktreeords.BlockTreeOrdsPostingsFormat)1 Lucene54Codec (org.apache.lucene.codecs.lucene54.Lucene54Codec)1 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)1 LogByteSizeMergePolicy (org.apache.lucene.index.LogByteSizeMergePolicy)1 MultipleBackupDeletionPolicy (org.neo4j.index.impl.lucene.legacy.MultipleBackupDeletionPolicy)1