Sha256: aa516775618b81a5fc914190e2de3e75025c63a89edc92600fe60ab54a1914ee
Contents?: true
Size: 980 Bytes
Versions: 1
Compression:
Stored size: 980 Bytes
Contents
window.Searcher = (function() { function Searcher() { this._index = lunr(function () { this.field('title', {boost: 10}) this.field('body') this.ref('id') }) ; this._indexContent = undefined; } Searcher.prototype.init = function() { var self = this; $("script[type='text/x-docstrap-searchdb']").each(function(idx, item) { self._indexContent = JSON.parse(item.innerHTML); for (var entryId in self._indexContent) { self._index.add(self._indexContent[entryId]); } }); }; Searcher.prototype.search = function(searchTerm) { var results = [], searchResults = this._index.search(searchTerm); for (var idx = 0; idx < searchResults.length; idx++) { results.push(this._indexContent[searchResults[idx].ref]) } return results; }; return new Searcher(); })();
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mdarray-sol-0.1.0-java | node_modules/dc/web/docs/html/scripts/fulltext-search.js |