summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/book.js b/lib/book.js
index c755c27..72f0ec2 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -1,7 +1,6 @@
var Q = require('q');
var _ = require('lodash');
var path = require('path');
-var lunr = require('lunr');
var parsers = require('gitbook-parsers');
var fs = require('./utils/fs');
@@ -78,16 +77,6 @@ var Book = function(root, context, parent) {
this.readmeFile = null;
this.langsFile = null;
- // Search Index
- this.searchIndexEnabled = true;
- this.searchIndexSize = 0;
- this.searchIndex = lunr(function () {
- this.ref('url');
-
- this.field('title', { boost: 10 });
- this.field('body');
- });
-
// Bind methods
_.bindAll(this);
};
@@ -595,7 +584,6 @@ Book.prototype.parsePage = function(filename, options) {
})
.then(function() {
- that.indexPage(page);
return page;
});
};
@@ -755,31 +743,6 @@ Book.prototype.contentLink = function(link) {
return links.normalize(this.contentPath(link));
};
-// Index a page into the search index
-Book.prototype.indexPage = function(page) {
- var nav = this.navigation[page.path];
- if (!nav || !this.searchIndexEnabled) return;
-
- this.log.debug.ln('index page', page.path);
-
- // Extract text from the page
- var text = pageUtil.extractText(page.sections);
-
- // Limit size of index (to avoid #941)
- this.searchIndexSize = this.searchIndexSize + text.length;
- if (this.searchIndexSize > this.config.get('search.maxIndexSize')) {
- this.log.warn.ln('search index is too big, indexing is now disabled');
- this.searchIndexEnabled = false;
- return;
- }
-
- this.searchIndex.add({
- url: this.contentLink(page.path),
- title: nav.title,
- body: text
- });
-};
-
// Default structure paths to an extension
Book.prototype._defaultsStructure = function(filename) {
var that = this;