Skip to content

Commit 127452f

Browse files
pheusjeremystretch
authored andcommitted
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
1 parent 2979067 commit 127452f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

netbox/extras/search.py

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ class JournalEntryIndex(SearchIndex):
2424
display_attrs = ('kind', 'created_by')
2525

2626

27+
@register_search
28+
class TagIndex(SearchIndex):
29+
model = models.Tag
30+
fields = (
31+
('name', 100),
32+
('slug', 110),
33+
('description', 500),
34+
)
35+
display_attrs = ('description',)
36+
37+
2738
@register_search
2839
class WebhookEntryIndex(SearchIndex):
2940
model = models.Webhook

0 commit comments

Comments
 (0)