Compare commits

...

4 Commits

Author SHA1 Message Date
75f99025d9 add exif dateTime, allow some special characters in text meta 2020-02-09 08:47:13 -05:00
ebe852bd5a Fix rewrite-url arg 2020-02-09 08:23:17 -05:00
402b103c49 Fix total count for ES 7.5 2020-02-08 09:25:00 -05:00
e9b6e1cdc2 Turn off auto optimisation in libtesseract build 2020-02-08 08:32:04 -05:00
10 changed files with 22 additions and 15 deletions

View File

@@ -75,7 +75,7 @@ cd tesseract
mkdir build mkdir build
cd build cd build
cmake -DSTATIC=on -DBUILD_TRAINING_TOOLS=off -DBUILD_TESTS=off -DCMAKE_BUILD_TYPE=Release \ cmake -DSTATIC=on -DBUILD_TRAINING_TOOLS=off -DBUILD_TESTS=off -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fPIC" .. -DCMAKE_CXX_FLAGS="-fPIC" -DAUTO_OPTIMIZE=off ..
make -j $THREADS make -j $THREADS
cd ../.. cd ../..
mv tesseract/build/libtesseract.a . mv tesseract/build/libtesseract.a .

View File

@@ -134,6 +134,8 @@ char *get_meta_key_text(enum metakey meta_key) {
return "exif_iso_speed_ratings"; return "exif_iso_speed_ratings";
case MetaExifModel: case MetaExifModel:
return "exif_model"; return "exif_model";
case MetaExifDateTime:
return "exif_datetime";
default: default:
return NULL; return NULL;
} }
@@ -278,6 +280,7 @@ void read_index_bin(const char *path, const char *index_id, index_func func) {
case MetaExifFocalLength: case MetaExifFocalLength:
case MetaExifUserComment: case MetaExifUserComment:
case MetaExifIsoSpeedRatings: case MetaExifIsoSpeedRatings:
case MetaExifDateTime:
case MetaExifModel: case MetaExifModel:
case MetaTitle: { case MetaTitle: {
buf.cur = 0; buf.cur = 0;

View File

@@ -6,7 +6,7 @@
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0" #define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
static const char *const Version = "1.2.7"; static const char *const Version = "1.2.9";
static const char *const usage[] = { static const char *const usage[] = {
"sist2 scan [OPTION]... PATH", "sist2 scan [OPTION]... PATH",
"sist2 index [OPTION]... INDEX", "sist2 index [OPTION]... INDEX",
@@ -49,6 +49,7 @@ void sist2_scan(scan_args_t *args) {
strncpy(ScanCtx.index.path, args->output, sizeof(ScanCtx.index.path)); strncpy(ScanCtx.index.path, args->output, sizeof(ScanCtx.index.path));
strncpy(ScanCtx.index.desc.name, args->name, sizeof(ScanCtx.index.desc.name)); strncpy(ScanCtx.index.desc.name, args->name, sizeof(ScanCtx.index.desc.name));
strncpy(ScanCtx.index.desc.root, args->path, sizeof(ScanCtx.index.desc.root)); strncpy(ScanCtx.index.desc.root, args->path, sizeof(ScanCtx.index.desc.root));
strncpy(ScanCtx.index.desc.rewrite_url, args->rewrite_url, sizeof(ScanCtx.index.desc.rewrite_url));
ScanCtx.index.desc.root_len = (short) strlen(ScanCtx.index.desc.root); ScanCtx.index.desc.root_len = (short) strlen(ScanCtx.index.desc.root);
ScanCtx.tesseract_lang = args->tesseract_lang; ScanCtx.tesseract_lang = args->tesseract_lang;
ScanCtx.tesseract_path = args->tesseract_path; ScanCtx.tesseract_path = args->tesseract_path;

View File

@@ -209,6 +209,8 @@ append_video_meta(AVFormatContext *pFormatCtx, AVFrame *frame, document_t *doc,
APPEND_TAG_META(doc, tag, MetaExifIsoSpeedRatings) APPEND_TAG_META(doc, tag, MetaExifIsoSpeedRatings)
} else if (strcmp(tag->key, "ExposureTime") == 0) { } else if (strcmp(tag->key, "ExposureTime") == 0) {
APPEND_TAG_META(doc, tag, MetaExifExposureTime) APPEND_TAG_META(doc, tag, MetaExifExposureTime)
} else if (strcmp(tag->key, "DateTime") == 0) {
APPEND_TAG_META(doc, tag, MetaExifDateTime)
} }
} }
} }

View File

@@ -39,6 +39,7 @@ enum metakey {
MetaExifUserComment = 20 | META_STR_MASK, MetaExifUserComment = 20 | META_STR_MASK,
MetaExifModel = 21 | META_STR_MASK, MetaExifModel = 21 | META_STR_MASK,
MetaExifIsoSpeedRatings = 22 | META_STR_MASK, MetaExifIsoSpeedRatings = 22 | META_STR_MASK,
MetaExifDateTime = 23 | META_STR_MASK,
//Note to self: this will break after 31 entries //Note to self: this will break after 31 entries
}; };

View File

@@ -7,7 +7,7 @@
#define INITIAL_BUF_SIZE 1024 * 16 #define INITIAL_BUF_SIZE 1024 * 16
#define SHOULD_IGNORE_CHAR(c) !(SHOULD_KEEP_CHAR(c)) #define SHOULD_IGNORE_CHAR(c) !(SHOULD_KEEP_CHAR(c))
#define SHOULD_KEEP_CHAR(c) ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'z') || (c > 127)) #define SHOULD_KEEP_CHAR(c) ((c >= '\'' && c <= ';') || (c >= 'A' && c <= 'z') || (c > 127))
typedef struct dyn_buffer { typedef struct dyn_buffer {

File diff suppressed because one or more lines are too long

View File

@@ -499,8 +499,7 @@ function makePreloader() {
function makePageIndicator(searchResult) { function makePageIndicator(searchResult) {
let pageIndicator = document.createElement("div"); let pageIndicator = document.createElement("div");
pageIndicator.setAttribute("class", "page-indicator font-weight-light"); pageIndicator.setAttribute("class", "page-indicator font-weight-light");
const totalHits = searchResult["hits"]["total"].hasOwnProperty("value") const totalHits = searchResult["aggregations"]["total_count"]["value"];
? searchResult["hits"]["total"]["value"] : searchResult["hits"]["total"];
pageIndicator.appendChild(document.createTextNode(docCount + " / " + totalHits)); pageIndicator.appendChild(document.createTextNode(docCount + " / " + totalHits));
return pageIndicator; return pageIndicator;
} }
@@ -547,8 +546,7 @@ function makeStatsCard(searchResult) {
}); });
let stat = document.createElement("span"); let stat = document.createElement("span");
const totalHits = searchResult["hits"]["total"].hasOwnProperty("value") const totalHits = searchResult["aggregations"]["total_count"]["value"];
? searchResult["hits"]["total"]["value"] : searchResult["hits"]["total"];
stat.appendChild(document.createTextNode(totalHits + " results in " + searchResult["took"] + "ms")); stat.appendChild(document.createTextNode(totalHits + " results in " + searchResult["took"] + "ms"));
statsCardBody.appendChild(stat); statsCardBody.appendChild(stat);

View File

@@ -363,7 +363,7 @@ function search(after = null) {
}, },
"sort": [ "sort": [
{"_score": {"order": "desc"}}, {"_score": {"order": "desc"}},
{"_tie": {"order":"asc"}} {"_tie": {"order": "asc"}}
], ],
highlight: { highlight: {
pre_tags: ["<mark>"], pre_tags: ["<mark>"],
@@ -376,11 +376,13 @@ function search(after = null) {
font_name: {}, font_name: {},
} }
}, },
aggs: { aggs:
total_size: {"sum": {"field": "size"}} {
}, total_size: {"sum": {"field": "size"}},
total_count: {"value_count": {"field": "size"}}
},
size: SIZE, size: SIZE,
} };
if (after) { if (after) {
q.search_after = [after["_score"], after["_id"]]; q.search_after = [after["_score"], after["_id"]];

View File

@@ -11,7 +11,7 @@
<nav class="navbar navbar-expand-lg"> <nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/">sist2</a> <a class="navbar-brand" href="/">sist2</a>
<span class="badge badge-pill version">v1.2.7</span> <span class="badge badge-pill version">v1.2.9</span>
<span class="tagline">Lightning-fast file system indexer and search tool </span> <span class="tagline">Lightning-fast file system indexer and search tool </span>
<a style="margin-left: auto" id="theme" class="btn" title="Toggle theme" href="/">Theme</a> <a style="margin-left: auto" id="theme" class="btn" title="Toggle theme" href="/">Theme</a>
</nav> </nav>