-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Search shows IP Addresses in created order, not ascending order. #13940
Comments
This is actually the case for all kind of models. I observed the same for the device, sites, .... |
While I certainly understand your expectation, IMO it's a bit of a gray area to treat this a bug. Search results are intentionally ordered first by precedence (weight), then by object type, and finally by object ID: class CachedValue:
class Meta:
ordering = ('weight', 'object_type', 'object_id') This is because 1) the ordering of values among matching results does not imply stronger or weaker relevance to the query, and 2) it's likely there are cases where sorting by raw value may result in unexpected ordering (though I can't think of any at the moment). I'd be open to treating this as a feature request if we give the later point a bit more consideration. |
Personally I'd expect at least IP addresses/ranges to show up in ascending order instead of the order they were created in. I understand that it is a gray area to consider it a bug after your explanation, but I would like this as a feature. |
I've opened FR #14035 to track this proposal. |
NetBox version
v3.6.3
Python version
3.11
Steps to Reproduce
Expected Behavior
All IPs matching show up in ascending order (similar to IP Addresses tab).
Observed Behavior
All IPs were shown in created order.
The text was updated successfully, but these errors were encountered: