From 08193e47a71b25249f64b873058f187b8558ad95 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 21 Oct 2022 08:31:58 -0400 Subject: [PATCH] Documentation updates --- docs/configuration/system.md | 8 ++++++++ docs/plugins/development/search.md | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/configuration/system.md b/docs/configuration/system.md index 93f8fa902..3756b6a83 100644 --- a/docs/configuration/system.md +++ b/docs/configuration/system.md @@ -157,6 +157,14 @@ The file path to the location where [custom scripts](../customization/custom-scr --- +## SEARCH_BACKEND + +Default: `'netbox.search.backends.CachedValueSearchBackend'` + +The dotted path to the desired search backend class. `CachedValueSearchBackend` is currently the only search backend provided in NetBox, however this setting can be used to enable a custom backend. + +--- + ## STORAGE_BACKEND Default: None (local storage) diff --git a/docs/plugins/development/search.md b/docs/plugins/development/search.md index 13edd4527..e3b861f00 100644 --- a/docs/plugins/development/search.md +++ b/docs/plugins/development/search.md @@ -4,17 +4,16 @@ Plugins can define and register their own models to extend NetBox's core search ```python # search.py -from netbox.search import SearchMixin -from .filters import MyModelFilterSet -from .tables import MyModelTable +from netbox.search import SearchIndex from .models import MyModel -class MyModelIndex(SearchMixin): +class MyModelIndex(SearchIndex): model = MyModel - queryset = MyModel.objects.all() - filterset = MyModelFilterSet - table = MyModelTable - url = 'plugins:myplugin:mymodel_list' + fields = ( + ('name', 100), + ('description', 500), + ('comments', 5000), + ) ``` To register one or more indexes with NetBox, define a list named `indexes` at the end of this file: