mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 18:26:43 +00:00
Fix #388
This commit is contained in:
parent
92478ec47c
commit
930361e78c
@ -83,6 +83,10 @@ void exec_args_destroy(exec_args_t *args) {
|
|||||||
free(args);
|
free(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sqlite_index_args_destroy(sqlite_index_args_t *args) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int scan_args_validate(scan_args_t *args, int argc, const char **argv) {
|
int scan_args_validate(scan_args_t *args, int argc, const char **argv) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr, "Required positional argument: PATH.\n");
|
fprintf(stderr, "Required positional argument: PATH.\n");
|
||||||
|
@ -134,5 +134,7 @@ void exec_args_destroy(exec_args_t *args);
|
|||||||
|
|
||||||
int exec_args_validate(exec_args_t *args, int argc, const char **argv);
|
int exec_args_validate(exec_args_t *args, int argc, const char **argv);
|
||||||
|
|
||||||
|
void sqlite_index_args_destroy(sqlite_index_args_t *args);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -447,12 +447,16 @@ database_summary_stats_t database_fts_get_date_range(database_t *db) {
|
|||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *get_after_where(char **after, fts_sort_t sort) {
|
char *get_after_where(char **after, fts_sort_t sort, int sort_asc) {
|
||||||
if (after == NULL) {
|
if (after == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sort_asc) {
|
||||||
return "(sort_var, doc.ROWID) > (?3, ?4)";
|
return "(sort_var, doc.ROWID) > (?3, ?4)";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "(sort_var, doc.ROWID) < (?3, ?4)";
|
||||||
}
|
}
|
||||||
|
|
||||||
cJSON *database_fts_search(database_t *db, const char *query, const char *path, long size_min,
|
cJSON *database_fts_search(database_t *db, const char *query, const char *path, long size_min,
|
||||||
@ -469,7 +473,7 @@ cJSON *database_fts_search(database_t *db, const char *query, const char *path,
|
|||||||
char *index_id_where = index_ids_where_clause(index_ids);
|
char *index_id_where = index_ids_where_clause(index_ids);
|
||||||
char *mime_where = mime_types_where_clause(mime_types);
|
char *mime_where = mime_types_where_clause(mime_types);
|
||||||
const char *query_where = match_where(query);
|
const char *query_where = match_where(query);
|
||||||
const char *after_where = get_after_where(after, sort);
|
const char *after_where = get_after_where(after, sort, sort_asc);
|
||||||
const char *tags_where = tags_where_clause(tags);
|
const char *tags_where = tags_where_clause(tags);
|
||||||
|
|
||||||
if (!query_where && sort == FTS_SORT_SCORE) {
|
if (!query_where && sort == FTS_SORT_SCORE) {
|
||||||
|
@ -681,6 +681,7 @@ int main(int argc, const char *argv[]) {
|
|||||||
index_args_destroy(index_args);
|
index_args_destroy(index_args);
|
||||||
web_args_destroy(web_args);
|
web_args_destroy(web_args);
|
||||||
exec_args_destroy(exec_args);
|
exec_args_destroy(exec_args);
|
||||||
|
sqlite_index_args_destroy(sqlite_index_args);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user