Description
NetBox version
v2.11.11
Feature type
New functionality
Proposed functionality
Extend NetBox's search functionality to employ PostgreSQL's native full text search capability. This is already supported by Django: https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/search/
I haven't dug into this too much yet, but it appears to be pretty straightforward. I expect the bulk of the work will involve replacing our sets of filter()
parameters with SearchQuery
and SearchVector
instances, and adding a common SearchVectorField
to all appropriate models.
I'm also open to alternative strategies for improving NetBox's global search performance, however any such proposals should be opened as separate feature requests and referenced here.
Use case
This change should provide much more robust search functionality, and allow us to rank search results according to customizable rankings per model.
Database changes
We'll likely need to add a new SearchVectorField to each searchable model.
External dependencies
No response