updated tests for offset query
parent
42d29b5e94
commit
20989628e4
|
@ -94,7 +94,7 @@ impl Searcher {
|
|||
/// should be ordered by. The field must be declared as a fast field
|
||||
/// when building the schema. Note, this only works for unsigned
|
||||
/// fields.
|
||||
/// offset (Field, optional): The offset from which the results have
|
||||
/// offset (Field, optional): The offset from which the results have
|
||||
/// to be returned.
|
||||
///
|
||||
/// Returns `SearchResult` object.
|
||||
|
@ -108,7 +108,7 @@ impl Searcher {
|
|||
limit: usize,
|
||||
count: bool,
|
||||
order_by_field: Option<&str>,
|
||||
offset: usize
|
||||
offset: usize,
|
||||
) -> PyResult<SearchResult> {
|
||||
let mut multicollector = MultiCollector::new();
|
||||
|
||||
|
|
|
@ -163,7 +163,13 @@ class TestClass(object):
|
|||
|
||||
query = index.parse_query("test")
|
||||
|
||||
|
||||
searcher = index.searcher()
|
||||
|
||||
result = searcher.search(query, 10, offset=2, order_by_field="order")
|
||||
|
||||
assert len(result.hits) == 1
|
||||
|
||||
result = searcher.search(query, 10, order_by_field="order")
|
||||
|
||||
assert len(result.hits) == 3
|
||||
|
|
Loading…
Reference in New Issue