Xapian::MultiValueSorter - allows sorting by a several values.
Results are ordered by the first value. In the event of a tie, the second is used. If this is the same for both, the third is used, and so on.
use Xapian;
my $db = new Xapian::Database("/path/to/db");
my $enq = new Xapian::Enquire($db);
my $sorter = new Xapian::MultiValueSorter(1, 3, 5);
$enq->set_sort_by_key($sorter);
Construct and add the values listed.
Add another value to sort on. By default, values sort forwards, unless forward is specified and is false.
https://xapian.org/docs/sourcedoc/html/classXapian_1_1MultiValueSorter.html