/** * Hook method that creates the right type of DocumentTree class. */ protected void createDocumentPostings(){ if (FieldScore.FIELDS_COUNT > 0) termsInDocument = new FieldDocumentPostingList(FieldScore.FIELDS_COUNT); else termsInDocument = new DocumentPostingList(); }
/** FIXME */ void createDocumentPostings() { if (numFields>0) termsInDocument = new FieldDocumentPostingList(numFields); else termsInDocument = new DocumentPostingList(); }
/** {@inheritDoc} * <p>NB: This implementation uses addToDocument(int, DocumentPostingList) * internally. */ @Override public boolean addToDocument(int docid, Document doc) throws Exception { // Don't index null documents. if (doc == null) return false; synchronized(indexingLock) { // Process terms through term pipeline. docPostings = new DocumentPostingList(); while (!doc.endOfDocument()) pipeline_first.processTerm(doc.getNextTerm()); return addToDocument(docid, docPostings); } }
/** * Index a new document. */ public void indexDocument(Document doc) throws Exception { synchronized(indexingLock) { // Don't index null documents. if (doc == null) return; // Process terms through term pipeline. docPostings = new DocumentPostingList(); while (!doc.endOfDocument()) pipeline_first.processTerm(doc.getNextTerm()); indexDocument(doc.getAllProperties(), docPostings); } }
/** * Index an unsearchable document. This performs a partial index document operation. * Term statistics and global statistics will be updated. But the inverted index will * not be. In effect, this adds a document to the index, but in such a way that it will * never be retrieved for any query. * * This is useful when you want to maintain collection statistics for a collection over * time, but do not need search functionality. */ public void indexUnDocument(Document doc) throws Exception { synchronized(indexingLock) { // Don't index null documents. if (doc == null) return; // Process terms through term pipeline. docPostings = new DocumentPostingList(); while (!doc.endOfDocument()) pipeline_first.processTerm(doc.getNextTerm()); indexUnDocument(doc.getAllProperties(), docPostings); } }