diff --git a/docs/development/search.md b/docs/development/search.md index 6ccffa7af..1c4eec169 100644 --- a/docs/development/search.md +++ b/docs/development/search.md @@ -17,6 +17,7 @@ class MyModelIndex(SearchIndex): ('description', 500), ('comments', 5000), ) + display_attrs = ('site', 'device', 'status', 'description') ``` A SearchIndex subclass defines both its model and a list of two-tuples specifying which model fields to be indexed and the weight (precedence) associated with each. Guidance on weight assignment for fields is provided below. diff --git a/docs/plugins/development/search.md b/docs/plugins/development/search.md index e3b861f00..e54844cf0 100644 --- a/docs/plugins/development/search.md +++ b/docs/plugins/development/search.md @@ -14,8 +14,11 @@ class MyModelIndex(SearchIndex): ('description', 500), ('comments', 5000), ) + display_attrs = ('site', 'device', 'status', 'description') ``` +Fields listed in `display_attrs` will not be cached for search, but will be displayed alongside the object when it appears in global search results. This is helpful for conveying to the user additional information about an object. + To register one or more indexes with NetBox, define a list named `indexes` at the end of this file: ```python