kopia lustrzana https://github.com/wagtail/wagtail
Use tuples in search_fields configuration
Not a requirement, just a best practisepull/457/head
rodzic
072f5c04e0
commit
3a8bc7f3ed
|
@ -133,14 +133,14 @@ To do this, inherit from ``indexed.Indexed`` and add some ``search_fields`` to t
|
|||
author = models.ForeignKey(Author)
|
||||
published_date = models.DateTimeField()
|
||||
|
||||
search_fields = [
|
||||
search_fields = (
|
||||
indexed.SearchField('title', partial_match=True, boost=10),
|
||||
indexed.SearchField('get_genre_display'),
|
||||
|
||||
indexed.FilterField('genre'),
|
||||
indexed.FilterField('author'),
|
||||
indexed.FilterField('published_date'),
|
||||
]
|
||||
)
|
||||
|
||||
# As this model doesn't have a search method in its QuerySet, we have to call search directly on the backend
|
||||
>>> from wagtail.wagtailsearch.backends import get_search_backend
|
||||
|
|
Ładowanie…
Reference in New Issue