Package it.unimi.dsi.mg4j.document

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


    int documentIndex = 0;

    while ( ( document = iterator.nextDocument() ) != null ) {
      for ( int i = 0; i < field.length; i++ ) {
        switch ( factory.fieldType( field[ i ] ) ) {
        case TEXT:
          processDocument( document.wordReader( field[ i ] ).setReader( (Reader)document.content( field[ i ] ) ), map == null ? documentIndex : map[ documentIndex ], 0, termMap[ i ],
              index[ i ].termProcessor );
          break;
        case VIRTUAL:
View Full Code Here


          public int compare( int[] p0, int[] p1 ) {
            return p0[ 0 ] - p1[ 0 ];
          }
        } );

        switch ( factory.fieldType( field[ i ] ) ) {
        case VIRTUAL:
          // We coalesce the list
          ObjectArrayList<int[]> newList = new ObjectArrayList<int[]>();
          for ( int k = 0; k < list.size(); ) {
            int s;
View Full Code Here

      }
    }


    for ( int i = 0; i < n; i++ ) {
      assertEquals( index[ i ].toString(), factory.fieldType( field[ i ] ) == FieldType.VIRTUAL ? maxDoc[ i ] + 1 : documentIndex, index[ i ].numberOfDocuments );
      switch ( factory.fieldType( field[ i ] ) ) {
      case TEXT:
      case VIRTUAL:
        assertEquals( termMap[ i ].size(), index[ i ].numberOfTerms );
        int postings = 0,
View Full Code Here

    }


    for ( int i = 0; i < n; i++ ) {
      assertEquals( index[ i ].toString(), factory.fieldType( field[ i ] ) == FieldType.VIRTUAL ? maxDoc[ i ] + 1 : documentIndex, index[ i ].numberOfDocuments );
      switch ( factory.fieldType( field[ i ] ) ) {
      case TEXT:
      case VIRTUAL:
        assertEquals( termMap[ i ].size(), index[ i ].numberOfTerms );
        int postings = 0,
        occurrences = 0;
View Full Code Here

        if ( documentIndex != 0 ) {
          IndexIterator indexIterator = index[ i ].documents( 0 );
          int k = 0;
          while ( indexIterator.hasNext() ) {
            assertEquals( payloadPointers[ i ].getInt( k ), indexIterator.nextDocument() );
            if ( factory.fieldType( field[ i ] ) == FieldType.INT ) assertEquals( ( (Number)payloadContent[ i ].get( k ) ).longValue(), ( (Number)indexIterator.payload().get() )
                .longValue() );
            else assertEquals( payloadContent[ i ].get( k ), indexIterator.payload().get() );
            k++;
          }
          indexIterator.dispose();
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.