function sort(desc, attr) {
const select = document.querySelector('#search-sort-field');
select.append(...Array
.from(select.children, n => [ n, n.getAttribute(attr) * (desc ? 1 : -1) ])
.sort((a, b) => a[1] - b[1])
.map(n => n[0])
);
}