Class LuceneTextIndexCreator

    • Field Detail

      • ENGLISH_STOP_WORDS_SET

        public static final org.apache.lucene.analysis.CharArraySet ENGLISH_STOP_WORDS_SET
    • Constructor Detail

      • LuceneTextIndexCreator

        public LuceneTextIndexCreator​(String column,
                                      File segmentIndexDir,
                                      boolean commit)
        Called by SegmentColumnarIndexCreator when building an offline segment. Similar to how it creates per column dictionary, forward and inverted index, a text index is also created if text search is enabled on a column.
        Parameters:
        column - column name
        segmentIndexDir - segment index directory
        commit - true if the index should be committed (at the end after all documents have been added), false if index should not be committed Note on commit: Once SegmentColumnarIndexCreator finishes indexing all documents/rows for the segment, we need to commit and close the Lucene index which will internally persist the index on disk, do the necessary resource cleanup etc. We commit during InvertedIndexCreator.seal() and close during Closeable.close(). This lucene index writer is used by both offline and realtime (both during indexing in-memory MutableSegment and later during conversion to offline). Since realtime segment conversion is again going to go through the offline indexing path and will do everything (indexing, commit, close etc), there is no need to commit the index from the realtime side. So when the realtime segment is destroyed (which is after the realtime segment has been committed and converted to offline), we close this lucene index writer to release resources but don't commit. This is the reason to have commit flag part of the constructor.