TP-55555 | fix es query for pagination
This commit is contained in:
@@ -65,7 +65,11 @@ func (s *SearchService) GetErrorDetails(c *gin.Context) {
|
||||
searchRequestformatted := es_query
|
||||
fields := []string{"error", "significant_stack", "title"}
|
||||
|
||||
var response, _, total, _ = s.elasticSearchClient.SearchDocuments(searchRequestformatted, fields)
|
||||
response, _, total, err := s.elasticSearchClient.SearchDocuments(searchRequestformatted, fields)
|
||||
|
||||
if err != nil {
|
||||
utils.ErrorResponse(c, "Failed to search please try again later")
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"results": response,
|
||||
"total": total,
|
||||
@@ -152,7 +156,7 @@ func (s *SearchService) GetErrorList(c *gin.Context) {
|
||||
var _, aggs, total, err = s.elasticSearchClient.SearchDocuments(final_query, fields)
|
||||
|
||||
if err != nil {
|
||||
c.JSON(http.StatusVariantAlsoNegotiates, "something went wrong ")
|
||||
utils.ErrorResponse(c, "search failed please try again")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user