fix for elasticsearch 6.8

This commit is contained in:
simon 2019-10-26 17:58:52 -04:00
parent 0d4deb3eb3
commit ef79681024
2 changed files with 4 additions and 4 deletions

View File

@ -70,7 +70,7 @@ void elastic_flush() {
while (line != NULL) {
char action_str[512];
snprintf(action_str, 512, "{\"index\":{\"_id\": \"%s\"}}\n", line->uuid_str);
snprintf(action_str, 512, "{\"index\":{\"_id\": \"%s\", \"_type\":\"_doc\"}}", line->uuid_str);
size_t action_str_len = strlen(action_str);
size_t line_len = strlen(line->line);
@ -187,7 +187,7 @@ void elastic_init(int force_reset) {
printf("Update settings <%d>\n", r->status_code);
free_response(r);
snprintf(url, 4096, "%s/sist2/_mappings", IndexCtx.es_url);
snprintf(url, 4096, "%s/sist2/_mappings/_doc", IndexCtx.es_url);
r = web_put(url, mappings_json, "Content-Type: application/json");
printf("Update mappings <%d>\n", r->status_code);
free_response(r);

View File

@ -5,7 +5,7 @@
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
static const char *const Version = "1.0.0";
static const char *const Version = "1.0.1";
static const char *const usage[] = {
"sist2 scan [OPTION]... PATH",
"sist2 index [OPTION]... INDEX",
@ -196,7 +196,7 @@ int main(int argc, const char *argv[]) {
index_args_t *index_args = index_args_create();
web_args_t *web_args = web_args_create();
char * common_es_url;
char * common_es_url = NULL;
struct argparse_option options[] = {
OPT_HELP(),