summaryrefslogtreecommitdiff
path: root/search/elasticlunr/query_index
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-04-29 18:50:33 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2018-04-29 18:50:33 +0200
commit50a4e701cd5791b5400ca4c8b438b17baee351b0 (patch)
tree6db06916d47297c8cde3008f1fa80265066b7982 /search/elasticlunr/query_index
parente2bcd2fa26b04fd2ea246b1eb765b9b52e7324fa (diff)
downloadwww-andreasbaumann-cc-50a4e701cd5791b5400ca4c8b438b17baee351b0.tar.gz
www-andreasbaumann-cc-50a4e701cd5791b5400ca4c8b438b17baee351b0.tar.bz2
replace google site search with an ElasticLunr search
Diffstat (limited to 'search/elasticlunr/query_index')
-rwxr-xr-xsearch/elasticlunr/query_index2
1 files changed, 1 insertions, 1 deletions
diff --git a/search/elasticlunr/query_index b/search/elasticlunr/query_index
index 4630ab7..90f61e5 100755
--- a/search/elasticlunr/query_index
+++ b/search/elasticlunr/query_index
@@ -10,7 +10,7 @@ fs.readFile( './posts.index', 'utf8', function( err, data ) {
}
var index = elasticlunr.Index.load( JSON.parse( data ) );
console.log( 'Index loaded..' );
- var results = index.search( 'the', { fields: { title : { boost : 2}, content : { boost : 1 } } } );
+ var results = index.search( 'the', { fields: { title : { boost : 2 }, content : { boost : 1 } } } );
for( var i = 0; i < results.length; i++ ) {
console.log( i + ". " + results[i]['ref'] + " " + results[i]['doc']['title'] );