Changeset 29945 for gs3-extensions

Show
Ignore:
Timestamp:
04.06.2015 19:01:08 (4 years ago)
Author:
ak19
Message:

Incremental building now works (again) for solr. The changes were 1. deleting a document should only contain the delete xml tags and an inner tag of the doc id, not the entire text and metadata as is necessary when adding a document. 2. Reindexing in solrbuildproc used to call textedit with the mode set to update, but update is not implemented in solrbuildproc, instead it now calls textedit first with the mode set to delete and then with the mode set to add.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/perllib/solrbuildproc.pm

    r28127 r29945  
    294294 
    295295    $end_doc    = "  </delete>\n";  
     296 
     297    # for delete mode, we need to specify just the docOID to delete and we're done 
     298    my $text = $start_doc; 
     299    $text .= $end_doc; 
     300    print $solrhandle $text; 
     301    return; 
    296302    } 
    297303 
     
    342348 
    343349        $end_sec    = "  </delete>\n";  
     350 
     351        # for delete mode, should specify only this section's docOID to delete, then move on to the next section 
     352        my $text = $start_sec; 
     353        $text .= $end_sec; 
     354        print $solrhandle $text; 
     355        $section = $doc_obj->get_next_section($section); 
     356        next; 
    344357    } 
    345358 
     
    642655    my ($doc_obj,$file) = @_; 
    643656 
    644     $self->textedit($doc_obj,$file,"update"); 
     657    # the update command does not exist in solrbuildproc 
     658    # reindexing consists of deleting and then adding the same file 
     659    #$self->textedit($doc_obj,$file,"update"); 
     660    $self->textedit($doc_obj,$file,"delete"); 
     661    $self->textedit($doc_obj,$file,"add"); 
    645662} 
    646663