netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Public demo: https://demo.netbox.dev
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.61k stars 2.53k forks source link

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

Open 991jo opened 9 months ago

991jo commented 9 months ago

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

abhi1693 commented 9 months ago

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.

jeremystretch commented 8 months ago

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.

github-actions[bot] commented 5 months ago

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.

jeremystretch commented 5 months ago

Marking this as blocked by #15413

jeremystretch commented 4 months ago

15413 has been completed for NetBox v4.0.

github-actions[bot] commented 14 hours ago

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.