Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Operate on entire index instead of 1 doc at a time

  • Loading branch information...
commit b468ea65d0e7d76c9d9a8851c2a5f0ca7b3d8bd1 1 parent 39fe500
@jeremyrsellars authored
Showing with 3 additions and 14 deletions.
  1. +3 −14 lib/IndexSearcher.js
View
17 lib/IndexSearcher.js
@@ -1,24 +1,17 @@
// Generated by CoffeeScript 1.3.3
(function() {
- var BitArray, IndexSearcher;
+ var BitArray;
BitArray = require('bit-array');
- IndexSearcher = (function() {
+ module.exports.IndexSearcher = (function() {
function IndexSearcher(index) {
this.index = index;
}
IndexSearcher.prototype.searchAllIndexesSync = function(query) {
- var b, n, _i, _ref;
- b = new BitArray;
- if (this.index.count()) {
- for (n = _i = 0, _ref = this.index.count() - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; n = 0 <= _ref ? ++_i : --_i) {
- b.set(n, query.IsMatchAtIndex(n, this));
- }
- }
- return b;
+ return query.search(this.index);
};
IndexSearcher.prototype.searchAllIndexes = function(query, callback) {
@@ -34,8 +27,4 @@
})();
- module.exports = {
- IndexSearcher: IndexSearcher
- };
-
}).call(this);
Please sign in to comment.
Something went wrong with that request. Please try again.