public int getDocumentLength(int docid) throws IOException { synchronized (parent) { return parent.getDocumentLength(docid); } }
public int getDocumentLength(int docid) throws IOException { synchronized (parent) { return parent.getDocumentLength(docid); } }
/** {@inheritDoc} */ public int getDocumentLength(int docid) throws IOException { int offset = 0, i = 0; for (DocumentIndex doc : docs) { if (docid < (offsets[i] + offset)) return doc.getDocumentLength(docid - offset); offset += offsets[i++]; } return 0; }
@Override public int getDocumentLength() { try{ return documentIndex.getDocumentLength(id); } catch (Exception e) { logger.error("Problem looking for doclength for document "+ id, e); return -1; } }
@Override public int getDocumentLength() { try{ return documentIndex.getDocumentLength(id); } catch (Exception e) { logger.error("Problem looking for doclength for document "+ id, e); return -1; } }
@Override public int getDocumentLength() { try{ return documentIndex.getDocumentLength(id); } catch (Exception e) { logger.error("Problem looking for doclength for document "+ id, e); return -1; } }
@Override public int getDocumentLength() { try{ return documentIndex.getDocumentLength(id); } catch (Exception e) { logger.error("Problem looking for doclength for document "+ id, e); return -1; } }
@Override public int getDocumentLength() { try { return doi.getDocumentLength(id); } catch (ArrayIndexOutOfBoundsException aioobe) { throw new RuntimeException("Problem looking for doclength for document "+ id + " -- docid out of bounds, possible (concurrent?) decompression error"); } catch (Exception e) { throw new RuntimeException("Unknown problem looking for doclength for document "+ id, e); } }
@Override public int getDocumentLength() { try { return doi.getDocumentLength(id); } catch (ArrayIndexOutOfBoundsException aioobe) { throw new RuntimeException("Problem looking for doclength for document "+ id + " -- docid out of bounds, possible (concurrent?) decompression error"); } catch (Exception e) { throw new RuntimeException("Unknown problem looking for doclength for document "+ id, e); } }
/** {@inheritDoc} */ public int getDocumentLength() { try { return doi.getDocumentLength(pl_doc.get(index)); } catch (IOException e) { e.printStackTrace(); return -1; } }
/** * Adds the feedback document from the index given a docid */ public void insertDocument(int docid, int rank, double score) throws IOException { totalDocumentLength += documentIndex.getDocumentLength(docid); final IterablePosting ip = directIndex.getPostings((BitIndexPointer)documentIndex.getDocumentEntry(docid)); if (ip == null) { logger.warn("document id "+docid+" not found"); return; } while(ip.next() != IterablePosting.EOL) { this.insertTerm(ip.getId(), ip.getFrequency()); } feedbackDocumentCount++; }
/** * Adds the feedback document from the index given a docid */ public void insertDocument(int docid, int rank, double score) throws IOException { totalDocumentLength += documentIndex.getDocumentLength(docid); final IterablePosting ip = directIndex.getPostings((BitIndexPointer)documentIndex.getDocumentEntry(docid)); if (ip == null) { logger.warn("document id "+docid+" not found"); return; } while(ip.next() != IterablePosting.EOL) { this.insertTerm(ip.getId(), ip.getFrequency()); } feedbackDocumentCount++; }
for(docid =0; docid < numberOfDocuments; docid++) assertEquals("Document lengths for docid "+ docid + " dont match", lengths[docid], di.getDocumentLength(docid)); assertEquals("Document lengths for docid "+ docid + " dont match", lengths[docid], di.getDocumentEntry(docid).getDocumentLength()); if (document_unique_terms.length > 0)
assertEquals(docindex1.getDocumentLength(i),docindex2.getDocumentLength(i));
assertEquals(3, doi.getDocumentLength(0)); assertEquals(4, doi.getDocumentLength(1)); if (fieldsExpected)
assertEquals(2, index.getDocumentIndex().getDocumentLength(0)); assertEquals(5, index.getDocumentIndex().getDocumentLength(0));
assertEquals(2, index.getCollectionStatistics().getFieldTokens()[0]); assertEquals(7, index.getCollectionStatistics().getFieldTokens()[1]); assertEquals(9, index.getDocumentIndex().getDocumentLength(0)); Matching matching = makeMatching(index); assertNotNull(matching);