Set default globalsearch lookuptype #10078

Closed
opened 2025-12-29 21:26:36 +01:00 by adam · 15 comments
Owner

Originally created by @PieterL75 on GitHub (Aug 13, 2024).

NetBox version

v4.0.8

Feature type

Data model extension

Proposed functionality

the default globalsearch lookuptype is set to partial match.
a user should be able to select its own preference for the default value.
another option, is that the last used lookuptype is saved for the user.

Use case

as a user I prefer to have the 'regex' as a default search option. currently, I have to search, change the lookuptype, search again.

Database changes

An extra selector field is required on the user profile.

External dependencies

No response

Originally created by @PieterL75 on GitHub (Aug 13, 2024). ### NetBox version v4.0.8 ### Feature type Data model extension ### Proposed functionality the default globalsearch lookuptype is set to partial match. a user should be able to select its own preference for the default value. another option, is that the last used lookuptype is saved for the user. ### Use case as a user I prefer to have the 'regex' as a default search option. currently, I have to search, change the lookuptype, search again. ### Database changes An extra selector field is required on the user profile. ### External dependencies _No response_
adam added the type: featurenetbox labels 2025-12-29 21:26:36 +01:00
adam closed this issue 2025-12-29 21:26:36 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 13, 2024):

This seems like it would result in a lot of confusion and frustration. Initializing the form with a predictable value every time is more user-friendly.

@jeremystretch commented on GitHub (Aug 13, 2024): This seems like it would result in a lot of confusion and frustration. Initializing the form with a predictable value every time is more user-friendly.
Author
Owner

@PieterL75 commented on GitHub (Aug 13, 2024):

I don't see how this can cause confusion. The setting should be retained per user. Each user than has the experience he choose.
I always change the search to regex, as looking for devices is easier like that (ex: server\d*.customername)

@PieterL75 commented on GitHub (Aug 13, 2024): I don't see how this can cause confusion. The setting should be retained per user. Each user than has the experience he choose. I always change the search to regex, as looking for devices is easier like that (ex: server\d*\.customername)
Author
Owner

@jeremystretch commented on GitHub (Aug 13, 2024):

I don't see how this can cause confusion.

  1. User changes the search type to "exact" and searches for something.
  2. User does something else.
  3. User returns and search for something entirely unrelated, but gets no results.
  4. User is confused because results were expected.
  5. User realizes the "exact" filter was still applied from an unrelated search, which was not intended.
@jeremystretch commented on GitHub (Aug 13, 2024): > I don't see how this can cause confusion. 1. User changes the search type to "exact" and searches for something. 2. User does something else. 3. User returns and search for something entirely unrelated, but gets no results. 4. User is confused because results were expected. 5. User realizes the "exact" filter was still applied from an unrelated search, which was not intended.
Author
Owner

@PieterL75 commented on GitHub (Aug 13, 2024):

That is not the behavior I propose. (But indeed an optional behavior, so let's ignore that one)

The FR is too allow the user to set the default lookup type for him. This will give him a consistent experience.

@PieterL75 commented on GitHub (Aug 13, 2024): That is not the behavior I propose. (But indeed an optional behavior, so let's ignore that one) The FR is too allow the user to set the default lookup type for him. This will give him a consistent experience.
Author
Owner

@jeremystretch commented on GitHub (Aug 13, 2024):

It's the same problem though, really. Once a default has been set for some temporary purpose, it will likely be forgotten.

@jeremystretch commented on GitHub (Aug 13, 2024): It's the same problem though, really. Once a default has been set for some temporary purpose, it will likely be forgotten.
Author
Owner

@PieterL75 commented on GitHub (Aug 13, 2024):

I can't imagine one sets the default and forget about it. It's the main used feature of NetBox. All I do is search, change the lookup, search again...

Maybe get some more voices and poll on slack?

@PieterL75 commented on GitHub (Aug 13, 2024): I can't imagine one sets the default and forget about it. It's the main used feature of NetBox. All I do is search, change the lookup, search again... Maybe get some more voices and poll on slack?
Author
Owner

@tobikris commented on GitHub (Feb 13, 2025):

What do you think of the following compromise?

  • No setting is added for this.
  • The URL to the search with regex matching selected is "exposed" to be able to create browser bookmarks.

I think this limits user confusion to the bare minimum as you need to click on your own bookmark and then ignore what is selected in the form.

@tobikris commented on GitHub (Feb 13, 2025): What do you think of the following compromise? * No setting is added for this. * The URL to the search with regex matching selected is "exposed" to be able to create browser bookmarks. I think this limits user confusion to the bare minimum as you need to click on your own bookmark and then ignore what is selected in the form.
Author
Owner

@lgerhold commented on GitHub (Feb 18, 2025):

I completely agree with the concerns raised in this issue. The current default setting for global search in NetBox is "partial match," which often leads to less relevant results, especially when searching for exact site names. Having to manually switch the lookup type to "exact match" for precise results is indeed cumbersome.

Implementing a feature that allows users to set their preferred default search behavior, or at least remembers the last used lookup type, would significantly enhance the user experience. This adjustment would streamline workflows by reducing repetitive actions and ensuring that search results align more closely with user expectations.

This enhancement aligns with previous discussions and issues where the need for more intuitive and user-friendly search functionalities has been highlighted.

@lgerhold commented on GitHub (Feb 18, 2025): I completely agree with the concerns raised in this issue. The current default setting for global search in NetBox is "partial match," which often leads to less relevant results, especially when searching for exact site names. Having to manually switch the lookup type to "exact match" for precise results is indeed cumbersome. Implementing a feature that allows users to set their preferred default search behavior, or at least remembers the last used lookup type, would significantly enhance the user experience. This adjustment would streamline workflows by reducing repetitive actions and ensuring that search results align more closely with user expectations. This enhancement aligns with previous discussions and issues where the need for more intuitive and user-friendly search functionalities has been highlighted.
Author
Owner

@fggec commented on GitHub (Feb 19, 2025):

I see both sides of that discussion. It would be nice to set the default search behavior for myself. On the other side i understand that for most standard users this could be confusing.

My approach would be: If we can not have this feature requested maybe it is possible to change the partial match behavior to set the match which is nearest to the query (often the exact match) is shown on first position. (sorting by relevance)

@fggec commented on GitHub (Feb 19, 2025): I see both sides of that discussion. It would be nice to set the default search behavior for myself. On the other side i understand that for most standard users this could be confusing. My approach would be: If we can not have this feature requested maybe it is possible to change the partial match behavior to set the match which is nearest to the query (often the exact match) is shown on first position. (sorting by relevance)
Author
Owner

@PieterL75 commented on GitHub (Apr 13, 2025):

Isn't a regex the same as a partial match ?
if you are used to search for 'router0', the regex will still return the same results.
Except that if the regex is the default, you have the extra power to do 'router0*.site1' to return only the routers wit suffix 'site1'

@PieterL75 commented on GitHub (Apr 13, 2025): Isn't a regex the same as a partial match ? if you are used to search for 'router0', the regex will still return the same results. Except that if the regex is the default, you have the extra power to do 'router0*.site1' to return only the routers wit suffix 'site1'
Author
Owner

@PieterL75 commented on GitHub (May 5, 2025):

There are already user-defined field.. Like how tables can be modified, the dashboard..
So why not go further on that personalization approach ?
I prefer 'regex match' on al my searches as default, @lgerhold prefers 'exact'. and others might prefer something else.
It is more a matter of convenience than 'standards'.
And if you (as a netbox admin) don't like that the option can be changed, then we can throw in an extra config var that enables/disabled this customization
Also, if the standard is 'regex' for everybody as of the start (of that netbox instance), then everybody is used to that way of searching.

@PieterL75 commented on GitHub (May 5, 2025): There are already user-defined field.. Like how tables can be modified, the dashboard.. So why not go further on that personalization approach ? I prefer 'regex match' on al my searches as default, @lgerhold prefers 'exact'. and others might prefer something else. It is more a matter of convenience than 'standards'. And if you (as a netbox admin) don't like that the option can be changed, then we can throw in an extra config var that enables/disabled this customization Also, if the standard is 'regex' for everybody as of the start (of that netbox instance), then everybody is used to that way of searching.
Author
Owner

@jeremystretch commented on GitHub (May 8, 2025):

Given that it's already possible to searching using a regex under the global search page, this doesn't seem to be worth the effort and risk of user confusion.

@jeremystretch commented on GitHub (May 8, 2025): Given that it's already possible to searching using a regex under the global search page, this doesn't seem to be worth the effort and risk of user confusion.
Author
Owner

@PieterL75 commented on GitHub (May 8, 2025):

I don't know, but this is a strange conclusion.
Yes, I can select regex, but only after I searched.

As a user, I want to control what my preferred search option is.

Please have a second review on this FR

@PieterL75 commented on GitHub (May 8, 2025): I don't know, but this is a strange conclusion. Yes, I can select regex, but only after I searched. As a user, I want to control what my preferred search option is. Please have a second review on this FR
Author
Owner

@peterbaumert commented on GitHub (Jun 6, 2025):

I don't get either why many times concerns from users are put down like this. If he made up his mind its not discussion anymore sadly.

@peterbaumert commented on GitHub (Jun 6, 2025): I don't get either why many times concerns from users are put down like this. If he made up his mind its not discussion anymore sadly.
Author
Owner

@jeremystretch commented on GitHub (Jun 7, 2025):

I did not "put down" anyone's concerns. The proposed functionality was duly considered and discussed just like the literal thousands of other feature requests submitted to this project. You don't have to agree with my decision, but it is absolutely unfair to characterize it as dismissive just because you're unhappy with it.

@jeremystretch commented on GitHub (Jun 7, 2025): I did not "put down" anyone's concerns. The proposed functionality was duly considered and discussed just like the literal thousands of other feature requests submitted to this project. You don't have to agree with my decision, but it is absolutely unfair to characterize it as dismissive just because you're unhappy with it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10078