Match parent-regions in searches when sites have been assigned a child-region #1541

Closed
opened 2025-12-29 16:32:48 +01:00 by adam · 4 comments
Owner

Originally created by @AriinPHD on GitHub (Feb 7, 2018).

Issue type

[X] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3-b2

Installed on Ubuntu Server 16.04.3 LTS by following the NetBox-provided installation documentation, without deviation.

Description

2 parts:

  1. Requesting that the NetBox frontpage search-bar allows searching for regions. Currently it does not allow this, nor does it have "regions" as a filterable option (read: the drop-down next to search bar does not include "Regions" as an option to filer the search).
  2. Requesting and that parent-regions be discovered by search even when a site is using its child-region. Currently search does not look for regions at all.

Example of usage:
Regions are setup as follows in a "parent -> child -> child of child -> child of child's child" manner.
--> [Country]
........|--> [Region]
..................|--> [City]
...........................|--> [Borough]

With this setup, a Site would be marked with region [Borough]. The region [Borough]is a child of [City] which is a child of [Region] which is a child of [Country]. In an example I want to search up all items available in region [City], but I do not want the Site to have [City] as its configured region. I want [Borough]. Simply to have the option available to really narrow things down.

A more practical example: This allows NetBox users the ability to search for all their New York-based sites despite all the Sites being marked with the "borough" regions such as Manhattan and Bronx.

I hope this is something you'll consider. I believe it will increase both the effectiveness and usefulnes of regions and power the searchbar. So far an RfE for this functionality is the only logical option for this type of usage as well; there are simply no alternatives for searchable parent-child like options in NetBox that I can find.

Thanks for a great product!

Originally created by @AriinPHD on GitHub (Feb 7, 2018). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. For assistance with installation issues, or for any other issues other than those listed below, please raise your topic for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. Due to an excessive backlog of feature requests, we are not currently accepting any proposals which extend NetBox's feature scope. Do not prepend any sort of tag to your issue's title. An administrator will review your issue and assign labels as appropriate. ---> ### Issue type [X] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: 3.5.2 <!-- Example: 3.5.4 --> * NetBox version: 2.3-b2 <!-- Example: 2.1.3 --> Installed on Ubuntu Server 16.04.3 LTS by following the NetBox-provided installation documentation, without deviation. <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description 2 parts: 1. Requesting that the NetBox frontpage search-bar allows searching for regions. Currently it does not allow this, nor does it have "regions" as a filterable option (read: the drop-down next to search bar does not include "Regions" as an option to filer the search). 2. Requesting and that parent-regions be discovered by search even when a site is using its child-region. Currently search does not look for regions at all. Example of usage: Regions are setup as follows in a "parent -> child -> child of child -> child of child's child" manner. --> [Country] ........|--> [Region] ..................|--> [City] ...........................|--> [Borough] With this setup, a Site would be marked with region [Borough]. The region [Borough]is a child of [City] which is a child of [Region] which is a child of [Country]. In an example I want to search up all items available in region [City], but I do not want the Site to have [City] as its configured region. I want [Borough]. Simply to have the option available to really narrow things down. A more practical example: This allows NetBox users the ability to search for all their New York-based sites despite all the Sites being marked with the "borough" regions such as Manhattan and Bronx. I hope this is something you'll consider. I believe it will increase both the effectiveness and usefulnes of regions and power the searchbar. So far an RfE for this functionality is the only logical option for this type of usage as well; there are simply no alternatives for searchable parent-child like options in NetBox that I can find. Thanks for a great product!
adam added the status: acceptedtype: feature labels 2025-12-29 16:32:48 +01:00
adam closed this issue 2025-12-29 16:32:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 13, 2018):

Requesting that the NetBox frontpage search-bar allows searching for regions

The global search does not include any organizational objects. Including these would return far too many irrelevant results. You can search for regions on the regions list.

Requesting and that parent-regions be discovered by search even when a site is using its child-region

This requires additional queryset filter logic; something like this. It would also need to be a separate filter from parent to preserve the ability to filter by exact match only.

@jeremystretch commented on GitHub (Feb 13, 2018): > Requesting that the NetBox frontpage search-bar allows searching for regions The global search does not include any organizational objects. Including these would return far too many irrelevant results. You can search for regions on the regions list. > Requesting and that parent-regions be discovered by search even when a site is using its child-region This requires additional queryset filter logic; [something like this](https://stackoverflow.com/a/10564253/2694522). It would also need to be a separate filter from `parent` to preserve the ability to filter by exact match only.
Author
Owner

@bdlamprecht commented on GitHub (May 14, 2018):

If I understand what this FR is asking for, I definately can see the need for this in my NetBox environment. Any idea when it could be implemented? Or would you prefer someone create a PR?

@bdlamprecht commented on GitHub (May 14, 2018): If I understand what this FR is asking for, I definately can see the need for this in my NetBox environment. Any idea when it could be implemented? Or would you prefer someone create a PR?
Author
Owner

@nue-melexis commented on GitHub (Sep 21, 2018):

Hi,

I currently have regions for continents, with child regions for countries.
Inside the countries I have the sites (so far).
For me it would be nice to see all the sites in one continent, so kind of recursive showing/counting.

current situation:
image

It would be nice to see a "4" in the count of sites for Asia. This could also be a global setting to turn on/off (recursive_regions).
I hope this is the same like the TO was intended to say.

Best Regards,
Norman

@nue-melexis commented on GitHub (Sep 21, 2018): Hi, I currently have regions for continents, with child regions for countries. Inside the countries I have the sites (so far). For me it would be nice to see all the sites in one continent, so kind of recursive showing/counting. current situation: ![image](https://user-images.githubusercontent.com/5212012/45870474-3f020180-bd8b-11e8-93a6-fb7ace18ba11.png) It would be nice to see a "4" in the count of sites for Asia. This could also be a global setting to turn on/off (recursive_regions). I hope this is the same like the TO was intended to say. Best Regards, Norman
Author
Owner

@bdlamprecht commented on GitHub (Jan 3, 2019):

Awesome!

@bdlamprecht commented on GitHub (Jan 3, 2019): Awesome!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1541