From e03317c2d993a2d9d2aa8db5e1afd7d6269c6d50 Mon Sep 17 00:00:00 2001 From: Roman Lomonosov Date: Mon, 11 Jun 2018 14:06:52 +0300 Subject: [PATCH] bugfix: ignore deleted metrics in tags autocomplete --- autocomplete/autocomplete.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autocomplete/autocomplete.go b/autocomplete/autocomplete.go index 1510ed66f..2e61fae86 100644 --- a/autocomplete/autocomplete.go +++ b/autocomplete/autocomplete.go @@ -118,6 +118,7 @@ func (h *Handler) ServeTags(w http.ResponseWriter, r *http.Request) { fromDate := time.Now().AddDate(0, 0, -h.config.ClickHouse.TaggedAutocompleDays) where.Andf("Date >= '%s'", fromDate.Format("2006-01-02")) + where.Andf("Deleted = 0") sql := fmt.Sprintf("SELECT %s FROM %s %s GROUP BY value ORDER BY value LIMIT %d", valueSQL, @@ -219,6 +220,7 @@ func (h *Handler) ServeValues(w http.ResponseWriter, r *http.Request) { fromDate := time.Now().AddDate(0, 0, -h.config.ClickHouse.TaggedAutocompleDays) where.Andf("Date >= '%s'", fromDate.Format("2006-01-02")) + where.Andf("Deleted = 0") sql := fmt.Sprintf("SELECT %s FROM %s %s GROUP BY value ORDER BY value LIMIT %d", valueSQL,