src/elastic-connection.c
int elastic_connection_delete_by_query(struct elastic_connection *conn,
                                       pool_t pool, string_t *query)
{
    FUNC_START();
    const char *path = NULL;

    if (conn == NULL || query == NULL) {
        i_error("fts_elastic: critical error during search scroll");
        return -1;
    }

    i_zero(conn->ctx);
    conn->ctx->pool = pool;
    conn->post_type = ELASTIC_POST_TYPE_DELETE_BY_QUERY;

	i_free_and_null(conn->http_failure);

    path = t_strconcat(conn->http_base_path, "_delete_by_query?routing=",
                                                    conn->username, NULL);
    elastic_connection_post(conn, path, query);

    if (conn->request_status < 0)
        return -1;

    FUNC_END_RET_INT(conn->ctx->found);
    return conn->ctx->found;
}
/* Performs elastic search delete by query
 */
Performs elastic search delete by query
Performs elastic search delete by query
int elastic_connection_delete_by_query(struct elastic_connection *conn,
                                       pool_t pool, string_t *query)
{
    FUNC_START();
    const char *path = NULL;
    if (conn == NULL || query == NULL) {
        i_error("fts_elastic: critical error during search scroll");
        return -1;
    }
    i_zero(conn->ctx);
    conn->ctx->pool = pool;
    conn->post_type = ELASTIC_POST_TYPE_DELETE_BY_QUERY;
	i_free_and_null(conn->http_failure);
    path = t_strconcat(conn->http_base_path, "_delete_by_query?routing=",
                                                    conn->username, NULL);
    elastic_connection_post(conn, path, query);
    if (conn->request_status < 0)
        return -1;
    FUNC_END_RET_INT(conn->ctx->found);
    return conn->ctx->found;
}
int elastic_connection_delete_by_query ( struct elastic_connection * conn , pool_t pool , string_t * query ) { FUNC_START ( ) ; const char * path = NULL ; if ( conn == NULL || query == NULL ) { i_error ( " " ) ; return -1 ; } i_zero ( conn -> ctx ) ; conn -> ctx -> pool = pool ; conn -> post_type = ELASTIC_POST_TYPE_DELETE_BY_QUERY ; i_free_and_null ( conn -> http_failure ) ; path = t_strconcat ( conn -> http_base_path , " " , conn -> username , NULL ) ; elastic_connection_post ( conn , path , query ) ; if ( conn -> request_status < 0 ) return -1 ; FUNC_END_RET_INT ( conn -> ctx -> found ) ; return conn -> ctx -> found ; }
Performs elastic search delete by query
Performs elastic search delete by query