hexo-algolia
Advanced tools
Comparing version 1.3.0 to 1.3.1
# hexo-algolia changelog | ||
## v1.3.1, 2018-12-19 | ||
- display the number of records in the batch and content types to index ([eb2ef14](https://github.com/oncletom/hexo-algolia/commit/eb2ef14)) | ||
- wait for clearIndex task completion before moving to the indexing part ([a7218ab](https://github.com/oncletom/hexo-algolia/commit/a7218ab)) | ||
## v1.3.0, 2018-12-09 | ||
@@ -4,0 +9,0 @@ |
@@ -130,4 +130,5 @@ 'use strict'; | ||
hexo.log.info( | ||
'[hexo-algolia] %d pages and posts to index.', | ||
publishedPagesAndPosts.length | ||
'[hexo-algolia] %d records to index (%s).', | ||
publishedPagesAndPosts.length, | ||
['post'].concat(pageLayouts).join(', ') | ||
); | ||
@@ -153,3 +154,18 @@ | ||
hexo.log.info('[hexo-algolia] Clearing index...'); | ||
return index.clearIndex(); | ||
return new Promise(function(resolve, reject){ | ||
index.clearIndex(function(error, content){ | ||
if (error) { | ||
return reject(error); | ||
} | ||
index.waitTask(content.taskID, function(error) { | ||
if (error) { | ||
return reject(error); | ||
} | ||
return resolve(); | ||
}); | ||
}); | ||
}); | ||
} | ||
@@ -162,10 +178,9 @@ }) | ||
hexo.log.info( | ||
'[hexo-algolia] Indexing chunk %d of %d (%d items each)', | ||
'[hexo-algolia] Indexing chunk %d of %d (%d records)', | ||
i + 1, | ||
chunks.length, | ||
options.chunkSize | ||
chunk.length | ||
); | ||
return client | ||
.batch(chunk) | ||
return client.batch(chunk) | ||
.catch(function(err){ | ||
@@ -172,0 +187,0 @@ hexo.log.error('[hexo-algolia] %s', err.message); |
{ | ||
"name": "hexo-algolia", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"lockfileVersion": 1, | ||
@@ -5,0 +5,0 @@ "requires": true, |
{ | ||
"name": "hexo-algolia", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Index content of your hexo website in Algolia and add search within minutes.", | ||
@@ -5,0 +5,0 @@ "main": "index", |
127681
1550