Examples of document()


Examples of it.unimi.dsi.mg4j.search.DocumentIterator.document()

    assertEquals( Interval.valueOf( 0, 1 ), differenceIterator.intervalIterator().nextInterval() );
    assertEquals( Interval.valueOf( 1, 2 ), differenceIterator.intervalIterator().nextInterval() );
    assertEquals( Interval.valueOf( 2, 3 ), differenceIterator.intervalIterator().nextInterval() );
    assertFalse( differenceIterator.intervalIterator().hasNext() );
    assertEquals( 3, differenceIterator.nextDocument() );
    assertEquals( 3, differenceIterator.document() );
    assertEquals( Interval.valueOf( 0 ), differenceIterator.intervalIterator().nextInterval() );
    assertFalse( differenceIterator.intervalIterator().hasNext() );
    assertFalse( differenceIterator.hasNext() ); // To increase coverage
  }
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.document()

        { { 1 } },
        } );
    DocumentIterator differenceIterator = DifferenceDocumentIterator.getInstance( minuendIterator, subtrahendIterator );
    assertTrue( differenceIterator.hasNext() );
    assertEquals( 0, differenceIterator.nextDocument() );
    assertEquals( 0, differenceIterator.document() );
    assertEquals( Interval.valueOf( 2, 3 ), differenceIterator.intervalIterator().nextInterval() );
    assertEquals( Interval.valueOf( 3, 4 ), differenceIterator.intervalIterator().nextInterval() );
    assertFalse( differenceIterator.intervalIterator().hasNext() );
    assertFalse( differenceIterator.hasNext() ); // To increase coverage
  }
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.document()

    scorer.wrap( documentIterator );
   
    int i = 0;
    while ( documentIterator.nextDocument() != -1 ) {
      final double score = scorer.score();
      assertEquals( "Item " + i + " (document " + documentIterator.document() + ")", expected[ i ], score, ASSERT_DIFF );
      i++;
    }
   
    documentIterator.dispose();
  }
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.document()

    int i = 0;
    while ( documentIterator.hasNext() ) {
      documentIterator.next();

      final double score = scorer.score();
      assertEquals( "Item " + i + " (document " + documentIterator.document() + ")", expected[ i ], score, ASSERT_DIFF );
      i++;
    }
   
    assertEquals( i, expected.length );
   
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.NotDocumentIterator.document()

        { {} },
        } );
   
    NotDocumentIterator notDocumentIterator = NotDocumentIterator.getInstance( i, 8 );
    assertEquals( 0, notDocumentIterator.nextDocument() );
    assertEquals( 0, notDocumentIterator.document() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
    assertEquals( 1, notDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
    assertEquals( 3, notDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.NotDocumentIterator.document()

    assertEquals( 1, notDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
    assertEquals( 3, notDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
    assertEquals( 5, notDocumentIterator.nextDocument() );
    assertEquals( 5, notDocumentIterator.document() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
    assertEquals( 6, notDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, notDocumentIterator.intervalIterator() );
    assertFalse( notDocumentIterator.hasNext() );
    notDocumentIterator.dispose();
View Full Code Here

Examples of net.yacy.document.content.DCEntry.document()

                this.log.logWarning("Rejected URL '" + surrogate.getIdentifier(true) + "': " + urlRejectReason);
                continue;
            }

            // create a queue entry
            final Document document = surrogate.document();
            final Request request = new Request(
                    ASCII.getBytes(this.peers.mySeed().hash),
                    surrogate.getIdentifier(true),
                    null,
                    "",
View Full Code Here

Examples of org.apache.lucene.index.DirectoryReader.document()

   
    Directory dir = newDirectory();
    RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
    iw.addDocument(doc);
    DirectoryReader ir = iw.getReader();
    Document sdoc = ir.document(0);
    assertEquals("5", sdoc.get("int"));
    assertNull(sdoc.get("somethingElse"));
    assertArrayEquals(new String[] { "5", "4" }, sdoc.getValues("int"));
    ir.close();
    iw.close();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.document()

      reader=IndexReader.open(FSDirectory.open(getDataFile()),true);
      int carcount=reader.maxDoc();
     
      Document[] docCache=new Document[carcount];
      for (int i=0;i<carcount;++i){
        docCache[i]=reader.document(i);
      }
     
      for (int i=0;i<numcars;++i){
        if (i!=0 && i%1000==0){
          System.out.println(i+" cars indexed.");
View Full Code Here

Examples of org.apache.lucene.index.MultiReader.document()

            if (reader.hasDeletions()) sb.append(" there are deletions @ version: N/A");
          }
            sb.append("\n");
          for(int i =0; i< sd.length; i++)
          {
            Document doc = reader.document(sd[i].doc);
            uids[i] = Long.parseLong(doc.get("id"));
            if (reader.isDeleted(sd[i].doc))
            {
              sb.append("doc: " + sd[i].doc + " with uid: " +
                  uids[i] + " has been deleted").append("\n");
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.