Tenant - Custom Field search not returning expected results #1317

Closed
opened 2025-12-29 16:31:23 +01:00 by adam · 2 comments
Owner

Originally created by @t0i on GitHub (Oct 16, 2017).

Issue type

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

Environment

  • Python version: 2.7.6
  • NetBox version: v2.2.1

Description

How to reproduce:
in Django admin > Custom Fields > Add Custom Field > Name: "CustomerID", Objects: select all objects, Type: Text. Hit Save.

In https://netboxurl.domain/tenancy/tenants/ > Create new tenant > Name client "Bob", under Custom Fields, enter "testing" in the CustomerID field. Hit Create.

Go to Top search bar, search for "testing" and we see no results on the page. URL for this page is "https://netboxurl.domain/search/?q=testing"


Expected results:
When I instead input the 'testing' text into the Comments field for the Tenant (Bob), then search for "testing", I get the expected search page which includes the Bob tenant.

Originally created by @t0i on GitHub (Oct 16, 2017). ### Issue type [ ] Feature request [X] Bug report [ ] Documentation ### Environment * Python version: 2.7.6 * NetBox version: v2.2.1 <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) --> ### Description How to reproduce: in Django admin > Custom Fields > Add Custom Field > Name: "CustomerID", Objects: select all objects, Type: Text. Hit Save. In https://netboxurl.domain/tenancy/tenants/ > Create new tenant > Name client "Bob", under Custom Fields, enter "testing" in the CustomerID field. Hit Create. Go to Top search bar, search for "testing" and we see no results on the page. URL for this page is "https://netboxurl.domain/search/?q=testing" --- Expected results: When I instead input the 'testing' text into the Comments field for the Tenant (Bob), then search for "testing", I get the expected search page which includes the Bob tenant.
adam closed this issue 2025-12-29 16:31:24 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 16, 2017):

The generic q filter does not search custom field values, because this is often undesired behavior. When you add the CustomerID field, a new search field appears at the bottom of the right-hand pane on the tenants list. Use this field to search the custom field.

@jeremystretch commented on GitHub (Oct 16, 2017): The generic `q` filter does not search custom field values, because this is often undesired behavior. When you add the `CustomerID` field, a new search field appears at the bottom of the right-hand pane on the tenants list. Use this field to search the custom field.
Author
Owner

@t0i commented on GitHub (Oct 16, 2017):

I have custom fields that cross all object types so its too much of a burden to search custom fields in the method netbox currently provides.

@t0i commented on GitHub (Oct 16, 2017): I have custom fields that cross all object types so its too much of a burden to search custom fields in the method netbox currently provides.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1317