hanahmily commented on code in PR #505: URL: https://github.com/apache/skywalking-banyandb/pull/505#discussion_r1704698294
########## pkg/index/inverted/inverted.go: ########## @@ -210,21 +210,31 @@ func (s *store) Iterator(fieldKey index.FieldKey, termRange index.RangeOpts, } if fieldKey.HasSeriesID() { - query = query.AddMust(bluge.NewTermQuery(string(fieldKey.SeriesID.Marshal())). + rangeQuery = rangeQuery.AddMust(bluge.NewTermQuery(string(fieldKey.SeriesID.Marshal())). SetField(seriesIDField)) if termRange.Lower != nil || termRange.Upper != nil { - query = addRange(query, termRange) + rangeQuery = addRange(rangeQuery, termRange) } } else { - query = addRange(query, termRange) + rangeQuery = addRange(rangeQuery, termRange) } sortedKey := fk if order == modelv1.Sort_SORT_DESC { sortedKey = "-" + sortedKey } + query := bluge.NewBooleanQuery().AddMust(rangeQuery) + if indexQuery != nil && indexQuery.(*Query).query != nil { + query.AddMust(indexQuery.(*Query).query) + } + fields := make([]string, 0, len(fieldKeys)) + for i := range fieldKeys { + fields = append(fields, fieldKeys[i].Marshal()) + } + // TODO: add trace information Review Comment: I agree. We should trace the query before merging it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org