You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All of my models that I want to have searchable already have a custom ModelAdmin. And all of them have a search_fields property which determines which fields I want to have searchable. It would be super nice if django-admin-site-search could stick to this as well, so that search happens in the fields that I want to be searchable, no more and no less (solving #21). This should give a performance boost by not using literally every CharField subclass, and should hopefully make searching through relations automatic as well (closing #20).
Great project by the way, the results look super slick.
The text was updated successfully, but these errors were encountered:
Thanks for the idea, and glad you like the project!
This is a great suggestion - it makes total sense.
The current approach is definitely "greedy", but I like that you get results out-of-the-box without much configuration. I've hesitated in adding further settings (to avoid the complexity), but this seems like an easy win.
I'll have a think about implementation and see if I can get round to it soon. Suspect it'll be an option, set at the class level, to specify the search method. Something like:
site_search_method = "model_char_fields" | "admin_search_fields" | etc.
All of my models that I want to have searchable already have a custom ModelAdmin. And all of them have a
search_fields
property which determines which fields I want to have searchable. It would be super nice if django-admin-site-search could stick to this as well, so that search happens in the fields that I want to be searchable, no more and no less (solving #21). This should give a performance boost by not using literally everyCharField
subclass, and should hopefully make searching through relations automatic as well (closing #20).Great project by the way, the results look super slick.
The text was updated successfully, but these errors were encountered: