Issue/range query (#242)

BitSet and RangeQuery
This commit is contained in:
Paul Masurel
2018-02-05 09:33:25 +09:00
committed by GitHub
parent 6a104e4f69
commit 1fc7afa90a
23 changed files with 1247 additions and 90 deletions

View File

@@ -8,7 +8,6 @@ use schema::Term;
use query::TermQuery;
use schema::IndexRecordOption;
use query::Occur;
use query::OccurFilter;
/// The boolean query combines a set of queries
///
@@ -39,14 +38,9 @@ impl Query for BooleanQuery {
fn weight(&self, searcher: &Searcher) -> Result<Box<Weight>> {
let sub_weights = self.subqueries
.iter()
.map(|&(ref _occur, ref subquery)| subquery.weight(searcher))
.map(|&(ref occur, ref subquery)| Ok((*occur, subquery.weight(searcher)?)))
.collect::<Result<_>>()?;
let occurs: Vec<Occur> = self.subqueries
.iter()
.map(|&(ref occur, ref _subquery)| *occur)
.collect();
let filter = OccurFilter::new(&occurs);
Ok(box BooleanWeight::new(sub_weights, filter))
Ok(box BooleanWeight::new(sub_weights))
}
}