lib: improve threaded sorting

Improve threaded sorting:
- rework the recursive algo (which should a crash noted earlier)
- sort by thread key (as in 1.5.7)

Fixes: #1923
Fixes: #1922
Fixes: #1911
Fixes: #1916
This commit is contained in:
Dirk-Jan C. Binnema
2021-02-10 12:35:19 +02:00
parent 58e4046cbd
commit 6ff9829ce1
5 changed files with 343 additions and 316 deletions

View File

@ -141,7 +141,7 @@ Query::Private::run_threaded (QueryResults &qres, Xapian::Enquire& enq,
{
const auto descending{any_of(qflags & QueryFlags::Descending)};
calculate_threads(qres, sortfieldid, descending);
calculate_threads(qres, descending);
ThreadKeyMaker key_maker{qres.query_matches()};
enq.set_sort_by_key(&key_maker, descending);