-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application
Milestone
Description
NetBox version
v3.6.3
Feature type
Change to existing functionality
Proposed functionality
When returning global search results, order results of equal precedence and object type by value. This should ensure that otherwise equally-relevant results appear in a human-friendly order.
The current ordering for cached search result objects is:
class CachedValue:
class Meta:
ordering = ('weight', 'object_type', 'object_id')This FR would modify the above to:
class CachedValue:
class Meta:
ordering = ('weight', 'object_type', 'value', 'object_id')(object_id is retained as a tie-breaker for results having the same matched value, to ensure deterministic ordering.)
Use case
This adjustment serves to ensure otherwise equally-relevant search results are listed in a human-friendly order. (This was first raised as a bug report under #13940.)
Database changes
This will require a model migration to effect the new default ordering for CachedValue.
External dependencies
None
PieterL75 and jjenjysk
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application