From 9b1cb354d49e1eae5c39cdade02c5616ff1acbb9 Mon Sep 17 00:00:00 2001 From: Jeffrey Picard Date: Thu, 17 Jun 2021 13:06:33 -0400 Subject: [PATCH] fix more index problems --- server/search.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/server/search.go b/server/search.go index f674073..b9838cc 100644 --- a/server/search.go +++ b/server/search.go @@ -416,18 +416,13 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs, if err != nil { log.Fatalln(err) } - var numIndices = 0 - if len(indices) > 0 { - numIndices = len(indices) - 1 - } - searchIndices = make([]string, numIndices) - j := 0 - for i := 0; j < numIndices; i++ { + var numIndices = len(indices) + searchIndices = make([]string, 0, numIndices) + for i := 0; i < numIndices; i++ { if indices[i] == "claims" { continue } - searchIndices[j] = indices[i] - j = j + 1 + searchIndices = append(searchIndices, indices[i]) } }