kopia lustrzana https://github.com/wagtail/wagtail
Release note for #1491
rodzic
5982ed3905
commit
2c765a7462
|
@ -5,6 +5,7 @@ Changelog
|
|||
~~~~~~~~~~~~~~~~
|
||||
|
||||
* Django 1.9 support
|
||||
* Support for indexing fields across relations in Elasticsearch
|
||||
* Added `WAGTAIL_PASSWORD_RESET_ENABLED` setting to allow password resets to be disabled independently of the password management interface (John Draper)
|
||||
* Updated fonts for more comprehensive Unicode support
|
||||
* Added `.alt` attribute to image renditions
|
||||
|
|
|
@ -16,6 +16,33 @@ Django 1.9 support
|
|||
Wagtail is now compatible with Django 1.9.
|
||||
|
||||
|
||||
Indexing fields across relations in Elasticsearch
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Fields on related objects can now be indexed in Elasticsearch using the new ``indexed.RelatedFields`` declaration type:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Book(models.Model, indexed.Indexed):
|
||||
...
|
||||
|
||||
search_fields = [
|
||||
indexed.SearchField('title'),
|
||||
indexed.FilterField('published_date'),
|
||||
|
||||
indexed.RelatedFields('author', [
|
||||
indexed.SearchField('name'),
|
||||
indexed.FilterField('date_of_birth'),
|
||||
]),
|
||||
]
|
||||
|
||||
# Search books where their author was born after 1950
|
||||
# Both the book title and the authors name will be searched
|
||||
>>> Book.objects.filter(author__date_of_birth__gt=date(1950, 1, 1)).search("Hello")
|
||||
|
||||
See: :ref:`wagtailsearch_index_relatedfields`
|
||||
|
||||
|
||||
Minor features
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ Options
|
|||
These are added to the search index but are not used for full-text searches. Instead, they allow you to run filters on your search results.
|
||||
|
||||
|
||||
.. _wagtailsearch_index_relatedfields:
|
||||
|
||||
``index.RelatedFields``
|
||||
-----------------------
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue