mirror of https://github.com/milvus-io/milvus.git
enhance: add recalls response for restful api (#39408)
issue: #37899 Signed-off-by: chasingegg <chao.gao@zilliz.com>pull/36416/head
parent
228bff5e7b
commit
9c4a81c80c
|
@ -120,6 +120,7 @@ const (
|
|||
HTTPReturnMessage = "message"
|
||||
HTTPReturnData = "data"
|
||||
HTTPReturnCost = "cost"
|
||||
HTTPReturnRecalls = "recalls"
|
||||
HTTPReturnLoadState = "loadState"
|
||||
HTTPReturnLoadProgress = "loadProgress"
|
||||
|
||||
|
|
|
@ -1142,7 +1142,11 @@ func (h *HandlersV2) search(ctx context.Context, c *gin.Context, anyReq any, dbN
|
|||
HTTPReturnMessage: merr.ErrInvalidSearchResult.Error() + ", error: " + err.Error(),
|
||||
})
|
||||
} else {
|
||||
HTTPReturnStream(c, http.StatusOK, gin.H{HTTPReturnCode: merr.Code(nil), HTTPReturnData: outputData, HTTPReturnCost: cost})
|
||||
if len(searchResp.Results.Recalls) > 0 {
|
||||
HTTPReturnStream(c, http.StatusOK, gin.H{HTTPReturnCode: merr.Code(nil), HTTPReturnData: outputData, HTTPReturnCost: cost, HTTPReturnRecalls: searchResp.Results.Recalls})
|
||||
} else {
|
||||
HTTPReturnStream(c, http.StatusOK, gin.H{HTTPReturnCode: merr.Code(nil), HTTPReturnData: outputData, HTTPReturnCost: cost})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue