Package it.unimi.dsi.mg4j.document

Examples of it.unimi.dsi.mg4j.document.DocumentFactory.fieldName()


    if ( numberOfIndexedFields == 0 ) throw new IllegalArgumentException( "You must specify at least one field" );
    final DocumentFactory factory = documentSequence.factory();
    final File tempDir = tempDirName == null ? null : new File( tempDirName );
    for ( int i = 0; i < indexedField.length; i++ )
      if ( factory.fieldType( indexedField[ i ] ) == DocumentFactory.FieldType.VIRTUAL && ( virtualDocumentResolver == null || virtualDocumentResolver[ i ] == null ) ) throw new IllegalArgumentException(
          "No resolver was associated with virtual field " + factory.fieldName( indexedField[ i ] ) );

    final int[] map = mapFile != null ? BinIO.loadInts( mapFile ) : null;

    final Scan[] scan = new Scan[ numberOfIndexedFields ]; // To scan textual content
    final PayloadAccumulator[] accumulator = new PayloadAccumulator[ numberOfIndexedFields ]; // To accumulate
View Full Code Here


    final ProgressLogger pl = new ProgressLogger( LOGGER, logInterval, "documents" );
    if ( documentSequence instanceof DocumentCollection ) pl.expectedUpdates = ( (DocumentCollection)documentSequence ).size();
 
   
    for ( int i = 0; i < numberOfIndexedFields; i++ ) {
      final String fieldName = factory.fieldName( indexedField[ i ] );
      switch ( factory.fieldType( indexedField[ i ] ) ) {
      case TEXT:
        scan[ i ] = new Scan( basename + '-' + fieldName, fieldName, completeness, termProcessor, map != null ? IndexingType.REMAPPED
            : IndexingType.STANDARD, 0, 0, bufferSize, builder, tempDir );
        break;
View Full Code Here

        if ( factory.fieldType( i ) != FieldType.VIRTUAL || virtualDocumentResolvers.containsKey( i ) ) indexedFields.add( i );
    }
   
    final int[] indexedField = indexedFields.toIntArray();
    final String[] basenameField = new String[ indexedField.length ];
    for( int i = 0; i < indexedField.length; i++ ) basenameField[ i ] = basename + "-" + factory.fieldName( indexedField[ i ] );
    LOGGER.info( "Creating indices " + Arrays.toString( basenameField ) + "..." );

    // Create gap array
    final int[] virtualDocumentGap = new int[ indexedField.length ];
    for( int i = 0; i < indexedField.length; i++ ) virtualDocumentGap[ i ] = virtualDocumentGaps.get( i );
View Full Code Here

    int totalTerms = 0;
   
    boolean allBitStreamIndices = true;
   
    for( i = 0; i < index.length; i++ ) {
      final String basenameField = basename + (stem ? "-" + factory.fieldName( indexedField[ i ] ) : "" );
      index[ i ] = Index.getInstance( basenameField );
      if ( ! ( index[ i ] instanceof BitStreamIndex ) ) allBitStreamIndices = false;
     
      if ( termLists ) {
        terms[ i ] = new ObjectArrayList<MutableString>( new FileLinesCollection( basenameField + DiskBasedIndex.TERMS_EXTENSION, "UTF-8" ).allLines() );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.