From 7d0a86ef52790f5bb1d72f455e8d432a30951e75 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Sat, 25 Jul 2026 14:18:00 +0200 Subject: [PATCH] fix(search): Add comments field to search indexing Include comments field with weight 5000 in search indexes for DeviceRole, L2VPN, MACAddress, and RouteTarget models to enable full-text search on comment content. Fixes #22767 --- netbox/dcim/search.py | 3 +++ netbox/ipam/search.py | 1 + 2 files changed, 4 insertions(+) diff --git a/netbox/dcim/search.py b/netbox/dcim/search.py index 3eebc6952..69dce3983 100644 --- a/netbox/dcim/search.py +++ b/netbox/dcim/search.py @@ -84,6 +84,7 @@ class DeviceRoleIndex(SearchIndex): ('name', 100), ('slug', 110), ('description', 500), + ('comments', 5000), ) display_attrs = ('description',) @@ -117,6 +118,7 @@ class MACAddressIndex(SearchIndex): fields = ( ('mac_address', 100), ('description', 500), + ('comments', 5000), ) display_attrs = ('assigned_object', 'description') @@ -239,6 +241,7 @@ class PlatformIndex(SearchIndex): ('name', 100), ('slug', 110), ('description', 500), + ('comments', 5000), ) display_attrs = ('manufacturer', 'description') diff --git a/netbox/ipam/search.py b/netbox/ipam/search.py index ad5086768..ec845541a 100644 --- a/netbox/ipam/search.py +++ b/netbox/ipam/search.py @@ -172,6 +172,7 @@ class VLANTranslationPolicyIndex(SearchIndex): fields = ( ('name', 100), ('description', 500), + ('comments', 5000), ) display_attrs = ('description',)