Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelewski committed May 17, 2024
1 parent 5a88997 commit f7ff7ad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions quesma/quesma/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,15 @@ func (q *QueryRunner) handleSearchCommon(ctx context.Context, indexPattern strin
oldHandlingUsed = true
fullQuery, columns := q.makeBasicQuery(ctx, queryTranslator, table, simpleQuery, queryInfo, highlighter)
queries := []model.Query{*fullQuery}
_ = queries
columnsSlice := make([][]string, 1)
columnsSlice := make([][]string, len(queries))
columnsSlice[0] = columns
if optAsync != nil {
go func() {
defer recovery.LogAndHandlePanic(ctx, func() {
optAsync.doneCh <- AsyncSearchWithError{err: errors.New("panic")}
})
translatedQueryBody, hitsSlice := q.searchAggregationWorker(ctx, queries, columnsSlice, table, false, optAsync)
hits = hitsSlice[0]
searchResponse, err := queryTranslator.MakeSearchResponse(hits, fullQuery.QueryInfo.Typ, fullQuery.Highlighter)
searchResponse, err := queryTranslator.MakeSearchResponse(hitsSlice[0], fullQuery.QueryInfo.Typ, fullQuery.Highlighter)
if err != nil {
logger.ErrorWithCtx(ctx).Msgf("error making response: %v, queryInfo: %+v, rows: %v", err, fullQuery.QueryInfo, hits)
optAsync.doneCh <- AsyncSearchWithError{translatedQueryBody: translatedQueryBody, err: err}
Expand Down

0 comments on commit f7ff7ad

Please sign in to comment.