For some reason under a docker build I get a build error under docker only saying that `serde::export` is private. This fixes it for me.
```
error[E0603]: module `export` is private
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tantivy-0.13.2/src/collector/top_collector.rs:5:12
|
5 | use serde::export::PhantomData;
| ^^^^^^ private module
|
note: the module `export` is defined here
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.119/src/lib.rs:275:5
|
275 | use self::__private as export;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
```
go_to_first_doc was typically calling seek with a target smaller than
doc.
Since SegmentPostings typically do a linear search on the full block,
regardless of the current position, it could have our segment postings
go backward.
* Do nothing when combining score values of excluded scores.
* Add test case for two excluded.
* Test score for two excluded terms.
* Use TopDocs in test_boolean_query_two_excluded
There was a bug in the LogMergePolicy that was surfacing when there were
segments, but all of the segments were larger than the max limit.
After filtering, the list of segments candidate for merge was 0, and
the code was indexing the first element of an empty Vec.
* Add offset to TopDocsCollector
Add an offset to TopDocsCollector and TopDocs to make it clearer how to
handle pagination.
Closes#822
* Address review comments
- Make Debug formatting of TopDocs clearer.
- Add unit tests for limit and offset on TopCollector.
- Change API for using offset to a fluent interface.
- Add some context to the docstring to clarify what limit and offset are
equivalent to in other projects.
* Changes required by rebase on e25284
- Pass Collector into TweakedScoreTopCollector and
CustomScoreTopCollector.
- Add std:: qualifier to f32, i32 etc. Not sure why this was not failing
already.
- Add unit tests for TopDocs with offset including for tweaked and
custom score collectors.
In order to convert a TopCollector<Score> to a TopCollector<TScore> I
had to add a `into_tscore` method to `TopCollector`. This is a hack but
I don't know how to avoid it.
- Change in the DocSet and Scorer API. (@fulmicoton).
A freshly created DocSet point directly to their first doc. A sentinel value called TERMINATED marks the end of a DocSet.
`.advance()` returns the new DocId. `Scorer::skip(target)` has been replaced by `Scorer::seek(target)` and returns the resulting DocId.
As a result, iterating through DocSet now looks as follows
```rust
let mut doc = docset.doc();
while doc != TERMINATED {
// ...
doc = docset.advance();
}
```
The change made it possible to greatly simplify a lot of the docset's code.
- Misc internal optimization and introduction of the `Scorer::for_each_pruning` function. (@fulmicoton)
* Make TweakScore and CustomScore mutable
Make TweakScore and CustomScore mutable at the segment level.
Addresses issue #806
* Add example to show tweak_score working for facets