netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Allow searching for ASNs with the prefix "AS".

Open 991jo opened this issue 2 years ago • 4 comments

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

991jo avatar Nov 07 '23 05:11 991jo

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 avatar Nov 09 '23 15:11 abhi1693

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 avatar Dec 07 '23 21:12 jeremystretch

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] avatar Mar 07 '24 04:03 github-actions[bot]

Marking this as blocked by #15413

jeremystretch avatar Mar 12 '24 15:03 jeremystretch

#15413 has been completed for NetBox v4.0.

jeremystretch avatar Apr 02 '24 18:04 jeremystretch

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] avatar Aug 22 '24 04:08 github-actions[bot]