Global.helma.Search.HitCollection (hits)
  • Parameter {org.lucene.search.Hits}:
    hits The hit collection returned by lucene.
Sourcecode in /home/hannes/helma/modules/helma/Search.js:
719:   helma.Search.HitCollection = function(hits) {
720:       /**
721:        * Silently converts the hit at the given index position into
722:        * an instance of helma.Search.Document.
723:        * @param {Number} idx The index position of the hit
724:        * @return The document object at the given index position
725:        * @type helma.Search.Document
726:        */
727:       this.get = function(idx) {
728:          var doc = new helma.Search.Document(hits.doc(idx));
729:          doc.score = hits.score(idx);
730:          doc.rank = idx +1;
731:          return doc;
732:      };
733:  
734:      /**
735:       * Returns the number of hits in this collection.
736:       * @return The number of hits.
737:       * @type Number
738:       */
739:      this.size = this.length = function() {
740:          return (hits != null) ? hits.length() : 0;
741:      };
742:  
743:      return this;
744:  }