Skip to content

lookup sorting #1855

@peterjanssens

Description

@peterjanssens

Am I wrong to conclude that [bundle]_lookup_sort configuration that combines _natural with another (like _natural;ca_entity_lables.name_sort) cannot pass beyond _natural ?

if ($primary_sort_field === '_natural') {

it seems here the items are returned early on the sliced primary_sort_field being _natural, so the secondary sort is never used/useful.

_natural on it's own (no semi-colon list) is already handled in

if ($vs_sort != '_natural') {

where the hits are not passed to re-sort (kept as-is).

most default conf/app.conf lookup_sorts combine _natural with something else, but most will probably not do what's stated?

I was under the assumption that _natural behaved like a mysql relevance score (like the comment states in SearchEngine (default is to sort on relevance (aka. sort='_natural')). But it seems to practically sort on the internal identifier (in case of entities the entity_id) ??

It's not a big deal to have custom conf/local sorts that align more to the project's use_case but in most cases labels would be more fit than the current _natural;.... ?? Identifiers fool systems sometimes when items are initially bulk imported in an order that makes sense to the domain, but not solid :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions