Global.helma.Search.Index.prototype.addDocuments (docs, mergeFactor)
Adds all documents in the passed collection to this index.

  • Parameter {java.util.Hashtable:
    | java.util.Vector | Array} docs The documents to add to the index.
Sourcecode in /home/hannes/helma/modules/helma/Search.js:
490:   helma.Search.Index.prototype.addDocuments = function(docs, mergeFactor) {
491:       try {
492:           var modifier = this.getModifier();
493:           if (mergeFactor) {
494:               modifier.setMergeFactor(mergeFactor);
495:           }
496:           if (docs instanceof java.util.Hashtable || docs instanceof java.util.Vector) {
497:               var e = docs.elements();
498:               while (e.hasMoreElements()) {
499:                  modifier.addDocument(e.nextElement().getDocument());
500:              }
501:          } else if (doc instanceof Array) {
502:              for (var i=0;i<docs.length;i++) {
503:                  modifier.addDocument(docs[i]);
504:              }
505:          }
506:      } finally {
507:          if (modifier != null) {
508:              modifier.close();
509:          }
510:      }
511:      return;
512:  }