From 16514fd6b08ac203adacfd9bd658a14febbcb0a4 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 9 May 2020 21:59:07 -0400 Subject: [PATCH] Option to search in path #49 --- schema/mappings.json | 11 ++++++++++- src/index/static_generated.c | 2 +- src/main.c | 2 +- src/static/js/dom.js | 22 ++++++++++++++++++++-- src/static/js/search.js | 20 +++++++++++++++++--- src/static/search.html | 7 ++++++- src/web/static_generated.c | 4 ++-- 7 files changed, 57 insertions(+), 11 deletions(-) diff --git a/schema/mappings.json b/schema/mappings.json index 5cb9d5c..fb57ecd 100644 --- a/schema/mappings.json +++ b/schema/mappings.json @@ -11,7 +11,16 @@ "type": "text", "analyzer": "path_analyzer", "fielddata": true, - "index_prefixes": {} + "fields": { + "nGram": { + "type": "text", + "analyzer": "my_nGram" + }, + "text": { + "type": "text", + "analyzer": "content_analyzer" + } + } }, "mime": { "type": "keyword" diff --git a/src/index/static_generated.c b/src/index/static_generated.c index 496cbfe..f53a450 100644 --- a/src/index/static_generated.c +++ b/src/index/static_generated.c @@ -1,3 +1,3 @@ -char mappings_json[1617] = {123,34,112,114,111,112,101,114,116,105,101,115,34,58,123,34,95,116,105,101,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,100,111,99,95,118,97,108,117,101,115,34,58,116,114,117,101,125,44,34,95,100,101,112,116,104,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,125,44,34,112,97,116,104,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,112,97,116,104,95,97,110,97,108,121,122,101,114,34,44,34,102,105,101,108,100,100,97,116,97,34,58,116,114,117,101,44,34,105,110,100,101,120,95,112,114,101,102,105,120,101,115,34,58,123,125,125,44,34,109,105,109,101,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,116,104,117,109,98,110,97,105,108,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,118,105,100,101,111,99,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,97,117,100,105,111,99,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,100,117,114,97,116,105,111,110,34,58,123,34,116,121,112,101,34,58,34,102,108,111,97,116,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,119,105,100,116,104,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,104,101,105,103,104,116,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,109,116,105,109,101,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,125,44,34,115,105,122,101,34,58,123,34,116,121,112,101,34,58,34,108,111,110,103,34,125,44,34,105,110,100,101,120,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,110,97,109,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,125,125,44,34,102,111,110,116,95,110,97,109,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,108,98,117,109,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,114,116,105,115,116,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,116,105,116,108,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,103,101,110,114,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,108,98,117,109,95,97,114,116,105,115,116,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,95,107,101,121,119,111,114,100,46,42,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,95,116,101,120,116,46,42,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,125,125,44,34,95,117,114,108,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,99,111,110,116,101,110,116,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,105,110,100,101,120,95,111,112,116,105,111,110,115,34,58,34,111,102,102,115,101,116,115,34,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,125,125,44,34,116,97,103,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,109,97,107,101,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,101,120,105,102,95,109,111,100,101,108,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,101,120,105,102,58,115,111,102,116,119,97,114,101,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,101,120,105,102,95,101,120,112,111,115,117,114,101,95,116,105,109,101,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,102,110,117,109,98,101,114,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,105,115,111,95,115,112,101,101,100,95,114,97,116,105,110,103,115,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,102,111,99,97,108,95,108,101,110,103,116,104,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,117,115,101,114,95,99,111,109,109,101,110,116,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,117,116,104,111,114,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,109,111,100,105,102,105,101,100,95,98,121,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,125,125,0}; +char mappings_json[1707] = {123,34,112,114,111,112,101,114,116,105,101,115,34,58,123,34,95,116,105,101,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,100,111,99,95,118,97,108,117,101,115,34,58,116,114,117,101,125,44,34,95,100,101,112,116,104,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,125,44,34,112,97,116,104,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,112,97,116,104,95,97,110,97,108,121,122,101,114,34,44,34,102,105,101,108,100,100,97,116,97,34,58,116,114,117,101,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,44,34,116,101,120,116,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,125,125,125,44,34,109,105,109,101,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,116,104,117,109,98,110,97,105,108,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,118,105,100,101,111,99,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,97,117,100,105,111,99,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,100,117,114,97,116,105,111,110,34,58,123,34,116,121,112,101,34,58,34,102,108,111,97,116,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,119,105,100,116,104,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,104,101,105,103,104,116,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,109,116,105,109,101,34,58,123,34,116,121,112,101,34,58,34,105,110,116,101,103,101,114,34,125,44,34,115,105,122,101,34,58,123,34,116,121,112,101,34,58,34,108,111,110,103,34,125,44,34,105,110,100,101,120,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,110,97,109,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,125,125,44,34,102,111,110,116,95,110,97,109,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,108,98,117,109,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,114,116,105,115,116,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,116,105,116,108,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,103,101,110,114,101,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,108,98,117,109,95,97,114,116,105,115,116,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,95,107,101,121,119,111,114,100,46,42,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,95,116,101,120,116,46,42,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,125,125,44,34,95,117,114,108,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,44,34,105,110,100,101,120,34,58,102,97,108,115,101,125,44,34,99,111,110,116,101,110,116,34,58,123,34,97,110,97,108,121,122,101,114,34,58,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,44,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,105,110,100,101,120,95,111,112,116,105,111,110,115,34,58,34,111,102,102,115,101,116,115,34,44,34,102,105,101,108,100,115,34,58,123,34,110,71,114,97,109,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,44,34,97,110,97,108,121,122,101,114,34,58,34,109,121,95,110,71,114,97,109,34,125,125,125,44,34,116,97,103,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,109,97,107,101,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,101,120,105,102,95,109,111,100,101,108,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,101,120,105,102,58,115,111,102,116,119,97,114,101,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,101,120,105,102,95,101,120,112,111,115,117,114,101,95,116,105,109,101,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,102,110,117,109,98,101,114,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,105,115,111,95,115,112,101,101,100,95,114,97,116,105,110,103,115,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,102,111,99,97,108,95,108,101,110,103,116,104,34,58,123,34,116,121,112,101,34,58,34,107,101,121,119,111,114,100,34,125,44,34,101,120,105,102,95,117,115,101,114,95,99,111,109,109,101,110,116,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,97,117,116,104,111,114,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,44,34,109,111,100,105,102,105,101,100,95,98,121,34,58,123,34,116,121,112,101,34,58,34,116,101,120,116,34,125,125,125,0}; char settings_json[525] = {123,34,105,110,100,101,120,34,58,123,34,114,101,102,114,101,115,104,95,105,110,116,101,114,118,97,108,34,58,34,51,48,115,34,44,34,99,111,100,101,99,34,58,34,98,101,115,116,95,99,111,109,112,114,101,115,115,105,111,110,34,125,44,34,97,110,97,108,121,115,105,115,34,58,123,34,116,111,107,101,110,105,122,101,114,34,58,123,34,112,97,116,104,95,116,111,107,101,110,105,122,101,114,34,58,123,34,116,121,112,101,34,58,34,112,97,116,104,95,104,105,101,114,97,114,99,104,121,34,125,44,34,109,121,95,110,71,114,97,109,95,116,111,107,101,110,105,122,101,114,34,58,123,34,116,121,112,101,34,58,34,110,71,114,97,109,34,44,34,109,105,110,95,103,114,97,109,34,58,51,44,34,109,97,120,95,103,114,97,109,34,58,51,125,125,44,34,97,110,97,108,121,122,101,114,34,58,123,34,112,97,116,104,95,97,110,97,108,121,122,101,114,34,58,123,34,116,111,107,101,110,105,122,101,114,34,58,34,112,97,116,104,95,116,111,107,101,110,105,122,101,114,34,44,34,102,105,108,116,101,114,34,58,91,34,108,111,119,101,114,99,97,115,101,34,93,125,44,34,99,97,115,101,95,105,110,115,101,110,115,105,116,105,118,101,95,107,119,95,97,110,97,108,121,122,101,114,34,58,123,34,116,111,107,101,110,105,122,101,114,34,58,34,107,101,121,119,111,114,100,34,44,34,102,105,108,116,101,114,34,58,91,34,108,111,119,101,114,99,97,115,101,34,93,125,44,34,109,121,95,110,71,114,97,109,34,58,123,34,116,111,107,101,110,105,122,101,114,34,58,34,109,121,95,110,71,114,97,109,95,116,111,107,101,110,105,122,101,114,34,44,34,102,105,108,116,101,114,34,58,91,34,108,111,119,101,114,99,97,115,101,34,44,34,97,115,99,105,105,102,111,108,100,105,110,103,34,93,125,44,34,99,111,110,116,101,110,116,95,97,110,97,108,121,122,101,114,34,58,123,34,116,111,107,101,110,105,122,101,114,34,58,34,115,116,97,110,100,97,114,100,34,44,34,102,105,108,116,101,114,34,58,91,34,108,111,119,101,114,99,97,115,101,34,44,34,97,115,99,105,105,102,111,108,100,105,110,103,34,93,125,125,125,125,0}; char pipeline_json[217] = {123,34,100,101,115,99,114,105,112,116,105,111,110,34,58,34,67,111,112,121,32,95,105,100,32,116,111,32,95,116,105,101,44,32,115,97,118,101,32,112,97,116,104,32,100,101,112,116,104,34,44,34,112,114,111,99,101,115,115,111,114,115,34,58,91,123,34,115,99,114,105,112,116,34,58,123,34,115,111,117,114,99,101,34,58,34,99,116,120,46,95,116,105,101,32,61,32,99,116,120,46,95,105,100,59,32,99,116,120,46,95,100,101,112,116,104,32,61,32,99,116,120,46,112,97,116,104,46,108,101,110,103,116,104,40,41,32,61,61,32,48,32,63,32,48,32,58,32,49,32,43,32,99,116,120,46,112,97,116,104,46,108,101,110,103,116,104,40,41,32,45,32,99,116,120,46,112,97,116,104,46,114,101,112,108,97,99,101,40,92,34,47,92,34,44,32,92,34,92,34,41,46,108,101,110,103,116,104,40,41,59,34,125,125,93,125,0}; diff --git a/src/main.c b/src/main.c index 9734dc1..d04ff4e 100644 --- a/src/main.c +++ b/src/main.c @@ -19,7 +19,7 @@ #define EPILOG "Made by simon987 . Released under GPL-3.0" -static const char *const Version = "2.1.2"; +static const char *const Version = "2.2.0"; static const char *const usage[] = { "sist2 scan [OPTION]... PATH", "sist2 index [OPTION]... INDEX", diff --git a/src/static/js/dom.js b/src/static/js/dom.js index 75f7969..6e03666 100644 --- a/src/static/js/dom.js +++ b/src/static/js/dom.js @@ -45,6 +45,18 @@ function getContentHighlight(hit) { return undefined; } +function getPathHighlight(hit) { + if (hit.hasOwnProperty("highlight")) { + if (hit["highlight"].hasOwnProperty("path.text")) { + return hit["highlight"]["path.text"][0]; + } else if (hit["highlight"].hasOwnProperty("path.nGram")) { + return hit["highlight"]["path.nGram"][0]; + } + } + + return undefined; +} + function applyNameToTitle(hit, title, extension) { if (hit.hasOwnProperty("highlight")) { if (hit["highlight"].hasOwnProperty("name")) { @@ -443,7 +455,7 @@ function createDocLine(hit) { if (contentHl !== undefined) { const contentDiv = document.createElement("div"); contentDiv.setAttribute("class", "content-div"); - contentDiv.insertAdjacentHTML('afterbegin', contentHl); + contentDiv.insertAdjacentHTML("afterbegin", contentHl); titleDiv.appendChild(contentDiv); } @@ -453,7 +465,13 @@ function createDocLine(hit) { let path = document.createElement("div"); path.setAttribute("class", "path-line"); path.setAttribute("title", hit["_source"]["path"] + "/"); - path.appendChild(document.createTextNode(hit["_source"]["path"] + "/")); + + const pathHighlight = getPathHighlight(hit); + if (pathHighlight) { + path.insertAdjacentHTML("afterbegin", pathHighlight + "/"); + } else { + path.appendChild(document.createTextNode(hit["_source"]["path"] + "/")); + } let tagContainer = document.createElement("div"); tagContainer.setAttribute("class", "tag-container"); diff --git a/src/static/js/search.js b/src/static/js/search.js index 29f0040..923700b 100644 --- a/src/static/js/search.js +++ b/src/static/js/search.js @@ -26,7 +26,8 @@ const _defaults = { display: "grid", fuzzy: true, highlight: true, - sort: "score" + sort: "score", + searchInPath: false, }; SORT_MODES = { @@ -66,7 +67,7 @@ SORT_MODES = { ], key: hit => hit["_source"]["size"] }, -} +}; function Settings() { this.options = {}; @@ -377,8 +378,15 @@ function search(after = null) { "font_name^6" ]; + if (CONF.options.searchInPath) { + fields.push("path.text^5"); + } + if ($("#fuzzyToggle").prop("checked")) { fields.push("content.nGram"); + if (CONF.options.searchInPath) { + fields.push("path.nGram"); + } fields.push("name.nGram^3"); } @@ -445,6 +453,10 @@ function search(after = null) { font_name: {}, } }; + if (CONF.options.searchInPath) { + q.highlight.fields["path.text"] = {}; + q.highlight.fields["path.nGram"] = {}; + } } $.jsonPost("es", q).then(searchResult => { @@ -661,7 +673,7 @@ function createPathTree(target) { depth: 0, children: true }) - }) + }); new InspireTreeDOM(pathTree, { target: target @@ -674,6 +686,7 @@ function updateSettings() { CONF.options.display = $("#settingDisplay").val(); CONF.options.fuzzy = $("#settingFuzzy").prop("checked"); CONF.options.highlight = $("#settingHighlight").prop("checked"); + CONF.options.searchInPath = $("#settingSearchInPath").prop("checked"); CONF.save(); searchDebounced(); @@ -696,4 +709,5 @@ function loadSettings() { $("#settingDisplay").val(CONF.options.display); $("#settingFuzzy").prop("checked", CONF.options.fuzzy); $("#settingHighlight").prop("checked", CONF.options.highlight); + $("#settingSearchInPath").prop("checked", CONF.options.searchInPath); } diff --git a/src/static/search.html b/src/static/search.html index 4df0767..abd1758 100644 --- a/src/static/search.html +++ b/src/static/search.html @@ -11,7 +11,7 @@