formated the searcher.rs file

master
sourcepirate 2020-09-05 23:58:59 +08:00
parent 89e1cabc58
commit e7b3e3527a
1 changed files with 4 additions and 3 deletions

View File

@ -119,8 +119,9 @@ impl Searcher {
let (mut multifruit, hits) = { let (mut multifruit, hits) = {
if let Some(order_by) = order_by_field { if let Some(order_by) = order_by_field {
let field = get_field(&self.inner.index().schema(), order_by)?; let field = get_field(&self.inner.index().schema(), order_by)?;
let collector = let collector = TopDocs::with_limit(limit)
TopDocs::with_limit(limit).and_offset(offset).order_by_u64_field(field); .and_offset(offset)
.order_by_u64_field(field);
let top_docs_handle = multicollector.add_collector(collector); let top_docs_handle = multicollector.add_collector(collector);
let ret = self.inner.search(&query.inner, &multicollector); let ret = self.inner.search(&query.inner, &multicollector);