enhance: fix copying hits of inverted index twice (#33968)

issue: https://github.com/milvus-io/milvus/issues/29793
The custom `VecCollector` have already transformed the results into
vector of offsets, no need to copy them twice.

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
This commit is contained in:
Jiquan Long 2024-06-19 12:40:01 +08:00 committed by GitHub
parent 5fac2fa1d2
commit 7b9462c0d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,11 +56,7 @@ impl IndexReaderWrapper {
fn search(&self, q: &dyn Query) -> Vec<u32> {
let searcher = self.reader.searcher();
let hits = searcher.search(q, &VecCollector).unwrap();
let mut ret = Vec::with_capacity(hits.len());
for address in hits {
ret.push(address);
}
ret
hits
}
pub fn term_query_i64(&self, term: i64) -> Vec<u32> {