@Override final public void reset() { dimensions.clear(); document.clear(); }
public Document createCCDocument(String docid, String author, String title, String content, String all) { doc.clear(); titleField.setStringValue(title); allField.setStringValue(all); textField.setStringValue(content); authorField.setStringValue(author); doc.add(docnumField); doc.add(authorField); doc.add(titleField); doc.add(textField); doc.add(allField); return doc; }
public Document createTipsterDocument(String docid, String title, String content, String all){ doc.clear(); docnumField.setStringValue(docid); titleField.setStringValue(title); allField.setStringValue(all); textField.setStringValue(content); doc.add(docnumField); doc.add(titleField); doc.add(textField); doc.add(allField); return doc; }
public Document createNEWSDocument(String docid, String author, String title, String content, String all) { doc.clear(); docnumField.setStringValue(docid); titleField.setStringValue(title); allField.setStringValue(all); textField.setStringValue(content); authorField.setStringValue(author); doc.add(docnumField); doc.add(authorField); doc.add(titleField); doc.add(textField); doc.add(allField); return doc; }
public Document createTRECWebDocument(String docid, String url, String dochdr, String title, String content, String all){ doc.clear(); docnumField.setStringValue(docid); titleField.setStringValue(title); allField.setStringValue(all); textField.setStringValue(content); urlField.setStringValue(url); dochdrField.setStringValue(dochdr); doc.add(docnumField); doc.add(urlField); doc.add(titleField); doc.add(textField); doc.add(dochdrField); doc.add(allField); System.out.println("Adding page: "+ url + " #" + docid + " Title: " + title); return doc; }
public Document createTRECAQUAINTDocument(String docid, String pubdate, String source, String title, String content, String all){ doc.clear(); docnumField.setStringValue(docid); titleField.setStringValue(title); allField.setStringValue(all); textField.setStringValue(content); sourceField.setStringValue(source); pubdateField.setStringValue(pubdate); doc.add(docnumField); doc.add(pubdateField); doc.add(sourceField); doc.add(titleField); doc.add(textField); doc.add(allField); System.out.println("Adding document: " + docid + " Title: " + title); return doc; }
doc.clear(); doc = createCacmDocument(fields[0],fields[1],fields[2],fields[3],fields[4]); addDocumentToIndex(doc);
/** * Will attempt to re-open index writer to recover from a specific exception. The method * assumes the caller has acquired the writer semaphore */ private void checkFailureAndRecover(Exception e) { // When document create or update fails with an exception. Clear the threadLocalDoc. Document threadLocalDoc = this.indexDocumentHelper.get().getDoc(); threadLocalDoc.clear(); if (getHost().isStopping()) { logInfo("Exception after host stop, on index service thread: %s", e.toString()); return; } if (!(e instanceof AlreadyClosedException)) { logSevere("Exception on index service thread: %s", Utils.toString(e)); return; } IndexWriter w = this.writer; if ((w != null && w.isOpen()) || e.getMessage().contains("IndexReader")) { // The already closed exception can happen due to an expired searcher, simply // log in that case adjustStat(STAT_NAME_READER_ALREADY_CLOSED_EXCEPTION_COUNT, 1); logWarning("Exception on index service thread: %s", Utils.toString(e)); return; } logSevere("Exception on index service thread: %s", Utils.toString(e)); this.adjustStat(STAT_NAME_WRITER_ALREADY_CLOSED_EXCEPTION_COUNT, 1); applyFileLimitRefreshWriter(true); }
threadLocalDoc.clear();