From 2abb56b457509305e5d593093b4707b059e919f2 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Wed, 30 Apr 2025 13:26:22 +0200 Subject: [PATCH] feat(search): Add search index for tags Introduces a search index for the Tag model to enable global search for Tags. Includes fields for name, slug, and description with corresponding weight values. Display attributes are limited to the description field. Fixes #17073 --- netbox/extras/search.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/netbox/extras/search.py b/netbox/extras/search.py index 9203b9144..feb235c29 100644 --- a/netbox/extras/search.py +++ b/netbox/extras/search.py @@ -24,6 +24,17 @@ class JournalEntryIndex(SearchIndex): display_attrs = ('kind', 'created_by') +@register_search +class TagIndex(SearchIndex): + model = models.Tag + fields = ( + ('name', 100), + ('slug', 110), + ('description', 500), + ) + display_attrs = ('description',) + + @register_search class WebhookEntryIndex(SearchIndex): model = models.Webhook