diff --git a/docs/release-notes/version-3.4.md b/docs/release-notes/version-3.4.md index b511aee98..8375e4094 100644 --- a/docs/release-notes/version-3.4.md +++ b/docs/release-notes/version-3.4.md @@ -2,6 +2,10 @@ ## v3.4.2 (FUTURE) +### Bug Fixes + +* [#11232](https://github.com/netbox-community/netbox/issues/11232) - Enable partial & regular expression matching for non-string types in global search + --- ## v3.4.1 (2022-12-16) diff --git a/netbox/netbox/search/backends.py b/netbox/netbox/search/backends.py index dfc251aa9..d659a7abb 100644 --- a/netbox/netbox/search/backends.py +++ b/netbox/netbox/search/backends.py @@ -99,8 +99,8 @@ class CachedValueSearchBackend(SearchBackend): params = { f'value__{lookup}': value } - if lookup != LookupTypes.EXACT: - # Partial matches are valid only on string values + if lookup in (LookupTypes.STARTSWITH, LookupTypes.ENDSWITH): + # Partial string matches are valid only on string values params['type'] = FieldTypes.STRING if object_types: params['object_type__in'] = object_types