Combining "Search" and "Filter" for IP Addresses #661

Closed
opened 2025-12-29 16:24:31 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Jan 23, 2017).

Perhaps I am being dense here, but if I go to /ipam/ip-addresses/ I am unable to search for a keyword within a filtered range.

In the Filter box it says "Search within (Prefix)", which to me implies that it should be possible to do a keyword search within the prefix.

To replicate:

  • In Search box, enter some text e.g. "mon"
  • In Filter > Search Within, enter a prefix e.g. "192.168.7.0/24"
  • If I click the magnifying glass next to the Search box, I get all hosts containing "mon" (not filtered to prefix)
  • If I click the "Apply" button at the bottom of the Filter area, I get all hosts in 192.168.7.0/24 (not filtered to "mon")

However, it is possible to do the search I want if I construct the URL manually: /ipam/ip-addresses/?parent=192.168.7.0%2F24&q=mon. This would be a useful search to do from the UI.

If Search and Filter are intended to be exclusive (and I note they are within separate bounding rectangles), maybe the wording could be made clearer, e.g. "Addresses within" rather than "Search within"

Clients tested under OSX 10.11, all same behaviour:

  • Chrome 55
  • Safari
  • Firefox 50.1.0
Originally created by @candlerb on GitHub (Jan 23, 2017). Perhaps I am being dense here, but if I go to `/ipam/ip-addresses/` I am unable to search for a keyword within a filtered range. In the Filter box it says "Search within *(Prefix)*", which to me implies that it should be possible to do a keyword search within the prefix. To replicate: * In Search box, enter some text e.g. "mon" * In Filter > Search Within, enter a prefix e.g. "192.168.7.0/24" * If I click the magnifying glass next to the Search box, I get *all* hosts containing "mon" (not filtered to prefix) * If I click the "Apply" button at the bottom of the Filter area, I get *all* hosts in 192.168.7.0/24 (not filtered to "mon") However, it is possible to do the search I want if I construct the URL manually: `/ipam/ip-addresses/?parent=192.168.7.0%2F24&q=mon`. This would be a useful search to do from the UI. If Search and Filter are intended to be exclusive (and I note they are within separate bounding rectangles), maybe the wording could be made clearer, e.g. "Addresses within" rather than "Search within" Clients tested under OSX 10.11, all same behaviour: * Chrome 55 * Safari * Firefox 50.1.0
adam added the type: feature label 2025-12-29 16:24:31 +01:00
adam closed this issue 2025-12-29 16:24:31 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 24, 2017):

The two panels on the side each contain a separate form, the first being a single-field keyword search (q) and the second being a set of fields derived from the model's FilterForm. These can be combined by adding the q query to the FilterForm. (For all NetBox objects, not just prefixes.)

@jeremystretch commented on GitHub (Jan 24, 2017): The two panels on the side each contain a separate form, the first being a single-field keyword search (`q`) and the second being a set of fields derived from the model's FilterForm. These can be combined by adding the `q` query to the FilterForm. (For all NetBox objects, not just prefixes.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#661