Struct tantivy::query::RangeQuery [] [src]

pub struct RangeQuery { /* fields omitted */ }

RangeQuery match all documents that have at least one term within a defined range.

Matched document will all get a constant Score of one.

Implementation

The current implement will iterate over the terms within the range and append all of the document cross into a BitSet.

Example


let searcher = index.searcher();

let docs_in_the_sixties = RangeQuery::new_u64(year_field, 1960..1970);

// ... or `1960..=1969` if inclusive range is enabled.
let mut count_collector = CountCollector::default();
docs_in_the_sixties.search(&*searcher, &mut count_collector)?;

let num_60s_books = count_collector.count();

Methods

impl RangeQuery
[src]

[src]

Create a new RangeQuery over a i64 field.

[src]

Create a new RangeQuery over a u64 field.

[src]

Create a new RangeQuery over a Str field.

Trait Implementations

impl Debug for RangeQuery
[src]

[src]

Formats the value using the given formatter. Read more

impl Query for RangeQuery
[src]

[src]

Used to make it possible to cast Box into a specific type. This is mostly useful for unit tests. Read more

[src]

Create the weight associated to a query. Read more

[src]

Search works as follows : Read more