return empty if 404 and log errors
This commit is contained in:
parent
27598d628b
commit
7a8e8b9b47
1 changed files with 6 additions and 2 deletions
|
@ -178,8 +178,12 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs,
|
|||
}
|
||||
|
||||
searchResult, err := search.Do(ctx) // execute
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
if err != nil && elastic.IsNotFound(err) {
|
||||
log.Println("Index returned 404! Check writer. Index: ", searchIndices)
|
||||
return &pb.Outputs{}, nil
|
||||
|
||||
} else if err != nil {
|
||||
log.Println("Error executing query: ", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue