1. 程式人生 > >nutch2.3.1 SolrDeleteDuplicates.java 去重時空指標崩潰

nutch2.3.1 SolrDeleteDuplicates.java 去重時空指標崩潰

修改原始碼如下:

    @Override
    public boolean nextKeyValue() throws IOException, InterruptedException {
        while(true){
            if (currentDoc >= numDocs) {
                return false;
            }
            SolrDocument doc = solrDocs.get(currentDoc);
            String digest = (String) doc.getFieldValue(SolrConstants.DIGEST_FIELD);
            if
(digest == null || digest.isEmpty()){ currentDoc++; continue; } text.set(digest); record.readSolrDocument(doc); currentDoc++; break; } return true; }