Allow searching for ASNs with the prefix "AS". #8812

Closed
opened 2025-12-29 20:41:34 +01:00 by adam · 6 comments
Owner

Originally created by @991jo on GitHub (Nov 7, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.6.4

Feature type

Change to existing functionality

Proposed functionality

The current global and the ASN quick search should return results independent of whether a user searches for "AS64496" or "64496".
Currently only the later returns results.

Use case

This should reduce errors and increase the search hit rate for ASNs.
Many other systems return ASNs as "AS64496" and the user simply copies that and finds no results in NetBox.
NetBox itself even formats the ASN Objects in the global search as "AS64496" instead of "64496".

Database changes

No response

External dependencies

No response

Originally created by @991jo on GitHub (Nov 7, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.6.4 ### Feature type Change to existing functionality ### Proposed functionality The current global and the ASN quick search should return results independent of whether a user searches for "AS64496" or "64496". Currently only the later returns results. ### Use case This should reduce errors and increase the search hit rate for ASNs. Many other systems return ASNs as "AS64496" and the user simply copies that and finds no results in NetBox. NetBox itself even formats the ASN Objects in the global search as "AS64496" instead of "64496". ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 20:41:34 +01:00
adam closed this issue 2025-12-29 20:41:34 +01:00
Author
Owner

@abhi1693 commented on GitHub (Nov 9, 2023):

I do not think this is possible to implement. The value in question is an interger field vs the object representation (suffixed with AS). The search cache adds the actual value rather than the string representation of the object, so a user must search for the value as 64496 only. You could however try to use the ends with type instead of partial match to workaround this issue.

@abhi1693 commented on GitHub (Nov 9, 2023): I do not think this is possible to implement. The value in question is an interger field vs the object representation (suffixed with `AS`). The search cache adds the actual value rather than the string representation of the object, so a user must search for the value as `64496` only. You could however try to use the `ends with` type instead of `partial match` to workaround this issue.
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2023):

We could enable this by extending SearchIndex to allow passing instance attributes in addition to fields, and adding a name property on ASN that returns e.g. "AS1234". Then, the string "AS1234" would be cached alongside the integer 1234.

@jeremystretch commented on GitHub (Dec 7, 2023): We could enable this by extending `SearchIndex` to allow passing instance attributes in addition to fields, and adding a `name` property on `ASN` that returns e.g. `"AS1234"`. Then, the string "AS1234" would be cached alongside the integer 1234.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 7, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Mar 7, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Mar 12, 2024):

Marking this as blocked by #15413

@jeremystretch commented on GitHub (Mar 12, 2024): Marking this as blocked by #15413
Author
Owner

@jeremystretch commented on GitHub (Apr 2, 2024):

#15413 has been completed for NetBox v4.0.

@jeremystretch commented on GitHub (Apr 2, 2024): #15413 has been completed for NetBox v4.0.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 22, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Aug 22, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8812