Skip to content

Commit

Permalink
relax elastic search query size limits
Browse files Browse the repository at this point in the history
  • Loading branch information
bitspill committed Feb 26, 2019
1 parent 0cc799b commit 580e1d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions httpapi/commonParams.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func commonParameterParser(next http.Handler) http.Handler {
}

limit := r.FormValue("limit")
size, _ := strconv.ParseInt(limit, 10, 0)
if size <= 0 || size > 1000 {
size = -1
var size int64 = -1
if limit != "" {
size, _ = strconv.ParseInt(limit, 10, 32)
}
ctx = context.WithValue(ctx, oipdSizeKey, int(size))

Expand Down
4 changes: 1 addition & 3 deletions httpapi/elastic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ func BuildCommonSearchService(ctx context.Context, indexNames []string, query *e
Query(query)

size := GetSizeFromContext(ctx)
if size != 0 {
searchService = searchService.Size(size)
}
searchService = searchService.Size(size)

nSorts := GetSortInfoFromContext(ctx)
nSorts = append(nSorts, sorts...)
Expand Down

0 comments on commit 580e1d1

Please sign in to comment.