Skip to content

Commit

Permalink
flexible solr job
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz authored and Lukasz committed Nov 14, 2013
1 parent 17c0d45 commit 34dcbf3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions webcrawler/job/solr.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ Solr.prototype.parseAndInsert = function( $, doc, el, callback ) {

content = self.applyFilter( content, rule );

if( content == '' ) {
return;
}

if( content && rule.prepend != undefined ) {
content = rule.prepend + content;
}

if( doc[ rule.field ] == undefined ) {
doc[ rule.field ] = content;
}
Expand All @@ -175,9 +183,8 @@ Solr.prototype.parseAndInsert = function( $, doc, el, callback ) {
/**
* Save only if there is at least one positive match
*/
if( saveDoc ) {
console.log( doc );
//this.save( doc, callback );
if( saveDoc && doc.id != undefined ) {
this.save( doc, callback );
}
else {
callback();
Expand Down

0 comments on commit 34dcbf3

Please sign in to comment.