public int getNumberOfCurrentPostings() { return doiEntry.getValue().getNumberOfEntries(); }
/** * Construct an instance of the class with * @param die */ public SimpleDocumentIndexEntry(DocumentIndexEntry die) { super.entries = die.getNumberOfEntries(); super.doclength = die.getDocumentLength(); } /**
/** * Construct an instance of the class with * @param die */ public SimpleDocumentIndexEntry(DocumentIndexEntry die) { super.entries = die.getNumberOfEntries(); super.doclength = die.getDocumentLength(); } /**
/** * Returns a five dimensional array containing the * term ids and the term frequencies for the given document. * @return int[][] a five dimensional array containing * the term ids, frequencies, field scores, * block frequencies and the containing the block ids. * @param docid the id of the document whose terms we are looking for. */ public int[][] getTerms(int docid) throws IOException { DocumentIndexEntry de = docIndex.getDocumentEntry(docid); if (de == null) return null; if (de.getNumberOfEntries() == 0) return null; return getTerms(de); }
/** * Returns a five dimensional array containing the * term ids and the term frequencies for the given document. * @return int[][] a five dimensional array containing * the term ids, frequencies, field scores, * block frequencies and the containing the block ids. * @param docid the id of the document whose terms we are looking for. */ public int[][] getTerms(int docid) throws IOException { DocumentIndexEntry de = docIndex.getDocumentEntry(docid); if (de == null) return null; if (de.getNumberOfEntries() == 0) return null; return getTerms(de); }
/** * Returns a two dimensional array containing the * term ids and the term frequencies for * the given document. * @return int[][] the two dimensional [n][3] array * containing the term ids, frequencies and field scores. If * the given document identifier is not found in the document * index, then the method returns null. If fields are not used, * then the dimension of the returned array are [n][2]. * @param docid the document identifier of the document which terms * we retrieve. */ public int[][] getTerms(int docid) throws IOException { DocumentIndexEntry de = docIndex.getDocumentEntry(docid); if (de == null) return null; if (de.getNumberOfEntries() == 0) return null; return getTerms(de); } /**
/** * Returns a two dimensional array containing the * term ids and the term frequencies for * the given document. * @return int[][] the two dimensional [n][3] array * containing the term ids, frequencies and field scores. If * the given document identifier is not found in the document * index, then the method returns null. If fields are not used, * then the dimension of the returned array are [n][2]. * @param docid the document identifier of the document which terms * we retrieve. */ public int[][] getTerms(int docid) throws IOException { DocumentIndexEntry de = docIndex.getDocumentEntry(docid); if (de == null) return null; if (de.getNumberOfEntries() == 0) return null; return getTerms(de); } /**
/** * Constructs an instance of the BasicDocumentIndexEntry. * @param in */ public BasicDocumentIndexEntry(DocumentIndexEntry in) { doclength = in.getDocumentLength(); entries = in.getNumberOfEntries(); bytes = in.getOffset(); bits = in.getOffsetBits(); bits += in.getFileNumber() << FILE_SHIFT; } /**
/** * Constructs an instance of the BasicDocumentIndexEntry. * @param in */ public BasicDocumentIndexEntry(DocumentIndexEntry in) { doclength = in.getDocumentLength(); entries = in.getNumberOfEntries(); bytes = in.getOffset(); bits = in.getOffsetBits(); bits += in.getFileNumber() << FILE_SHIFT; } /**
if (die instanceof FieldDocumentIndexEntry) System.err.println("Field Lengths: " + ArrayUtils.join(((FieldDocumentIndexEntry)die).getFieldLengths(), ",")); if (die.getNumberOfEntries() > 0) System.err.println("Document Uniq Terms: " + die.getNumberOfEntries());
if (die instanceof FieldDocumentIndexEntry) System.err.println("Field Lengths: " + ArrayUtils.join(((FieldDocumentIndexEntry)die).getFieldLengths(), ",")); if (die.getNumberOfEntries() > 0) System.err.println("Document Uniq Terms: " + die.getNumberOfEntries());
assertEquals("Document lengths for docid "+ docid + " dont match", lengths[docid], di.getDocumentEntry(docid).getDocumentLength()); if (document_unique_terms.length > 0) assertEquals("Number of pointers for docid " + docid + " dont match", document_unique_terms[docid], di.getDocumentEntry(docid).getNumberOfEntries());