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