From 13fdbd9e697c562d8d493a0d1706adfffcf6d877 Mon Sep 17 00:00:00 2001 From: simon987 Date: Mon, 1 Jun 2020 18:14:06 -0400 Subject: [PATCH] Fix for ES 7.7 #54 --- src/main.c | 2 +- src/static/js/search.js | 14 ++++++++------ src/static/search.html | 2 +- src/web/static_generated.c | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main.c b/src/main.c index 377cf3a..8a51575 100644 --- a/src/main.c +++ b/src/main.c @@ -22,7 +22,7 @@ #define EPILOG "Made by simon987 . Released under GPL-3.0" -static const char *const Version = "2.3.2"; +static const char *const Version = "2.3.3"; static const char *const usage[] = { "sist2 scan [OPTION]... PATH", "sist2 index [OPTION]... INDEX", diff --git a/src/static/js/search.js b/src/static/js/search.js index 6f0df63..05d7b4e 100644 --- a/src/static/js/search.js +++ b/src/static/js/search.js @@ -332,24 +332,24 @@ function search(after = null) { let path = pathBar.value.replace(/\/$/, "").toLowerCase(); //remove trailing slashes if (path !== "") { - filters.push([{term: {path: path}}]) + filters.push({term: {path: path}}) } let mimeTypes = getSelectedNodes(mimeTree); if (!mimeTypes.includes("any")) { - filters.push([{terms: {"mime": mimeTypes}}]); + filters.push({terms: {"mime": mimeTypes}}); } let tags = getSelectedNodes(tagTree); if (!tags.includes("any")) { - filters.push([{terms: {"tag": tags}}]); + filters.push({terms: {"tag": tags}}); } if (date_min && date_max) { - filters.push([{range: {mtime: {gte: date_min, lte: date_max}}}]) + filters.push({range: {mtime: {gte: date_min, lte: date_max}}}) } else if (date_min) { - filters.push([{range: {mtime: {gte: date_min}}}]) + filters.push({range: {mtime: {gte: date_min}}}) } else if (date_max) { - filters.push([{range: {mtime: {lte: date_max}}}]) + filters.push({range: {mtime: {lte: date_max}}}) } let q = { @@ -399,6 +399,8 @@ function search(after = null) { } } + console.log(q) + $.jsonPost("es", q).then(searchResult => { let hits = searchResult["hits"]["hits"]; if (hits) { diff --git a/src/static/search.html b/src/static/search.html index 553ce7f..03095ab 100644 --- a/src/static/search.html +++ b/src/static/search.html @@ -11,7 +11,7 @@