mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
handle the top-n limit for small result sets
This commit is contained in:
parent
0598bfc686
commit
5862eba0d1
1 changed files with 5 additions and 1 deletions
|
|
@ -190,7 +190,11 @@ func (self *Service) CatQueryStepHandler(msg *db.Message) {
|
|||
for _, r := range rank_list {
|
||||
pair_list = append(pair_list, *r.Pair)
|
||||
}
|
||||
result = pair_list[:qs.N]
|
||||
if len(pair_list) > 0 && len(pair_list) > qs.N {
|
||||
result = pair_list[:qs.N]
|
||||
} else {
|
||||
result = pair_list
|
||||
}
|
||||
} else {
|
||||
result = "NONE"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue