Changes between Initial Version and Version 1 of Ticket #28852, comment 2


Ignore:
Timestamp:
Dec 27, 2017, 12:22:43 PM (6 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28852, comment 2

    initial v1  
    1 > What do you think of overriding ModelAdmin.get_queryset to use .annotate(sv=SearchVector(...)) and then specifying 'sv__search' in the ModelAdmin.search_fields? It looks like that won't work with the current implementation, as search_fields must be model fields and not queryset annotations.
     1> What do you think of overriding `ModelAdmin.get_queryset` to use `.annotate(sv=SearchVector(...))` and then specifying `'sv__search'` in the `ModelAdmin.search_fields`? It looks like that won't work with the current implementation, as search_fields must be model fields and not queryset annotations.
    22
    33From what I can see that won't really work either even if you were to override the modeladmin queryset. Being able to set the config of the search vector and the search query is key to be able to use the index. 
Back to Top