Skip to content

Enable caching of object attributes in search index #15413

Closed
@jeremystretch

Description

@jeremystretch

NetBox version

v3.7.3

Feature type

New functionality

Proposed functionality

Extend SearchIndex to enable caching object attributes in addition to concrete model fields. This can be achieved by tweaking its get_field_type() method to also accept attributes. (get_field_value() probably doesn't need modification as it's simply wrapping getattr().)

Use case

This will enable NetBox to capture rendered attributes in addition to raw database values. For instance, #14201 requests caching the number of an ASN object as the string "AS1234" in addition to the plain numeric value.

Database changes

None expected

External dependencies

None

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions