Class IndexBuilder


  • public class IndexBuilder
    extends Object
    An index builder.

    An instance of this class exposes a run() method that will index the DocumentSequence provided at construction time by calling Scan and Combine in sequence.

    Additionally, a main method provides easy access to index construction.

    All indexing parameters are available either as chainable setters that can be called optionally before invoking run(), or as public mutable collections and maps. For instance,

     new IndexBuilder( "foo", sequence ).skips( true ).run();
     
    will build an index with basename foo using skips. If instead we want to index just the first field of the sequence, and use a ShiftAddXorSignedStringMap as a term map, we can use the following code:
     new IndexBuilder( "foo", sequence )
         .termMapClass( ShiftAddXorSignedMinimalPerfectHash.class )
         .indexedFields( 0 ).run();
     

    More sophisticated modifications can be applied using public maps:

     IndexBuilder indexBuilder = new IndexBuilder( "foo", sequence );
     indexBuilder.virtualDocumentGaps.put( 0, 30 );
     indexBuilder.virtualDocumentResolver.put( 0, someVirtualDocumentResolver );
     indexBuilder.run();