소스 검색

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 3 일 전
부모
커밋
7d0a86ef52
2개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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',)