Ver Fonte

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
Martin Hauser há 4 dias atrás
pai
commit
7d0a86ef52
2 ficheiros alterados com 4 adições e 0 exclusões
  1. 3 0
      netbox/dcim/search.py
  2. 1 0
      netbox/ipam/search.py

+ 3 - 0
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')
 

+ 1 - 0
netbox/ipam/search.py

@@ -172,6 +172,7 @@ class VLANTranslationPolicyIndex(SearchIndex):
     fields = (
         ('name', 100),
         ('description', 500),
+        ('comments', 5000),
     )
     display_attrs = ('description',)