updated tests for offset query

master
sourcepirate 2020-09-06 18:26:17 +08:00 committed by Damir Jelić
parent 42d29b5e94
commit 20989628e4
2 changed files with 8 additions and 2 deletions

View File

@ -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();

View File

@ -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