We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add dynamic range slider for publication year facet
see <https://opensource.appbase.io/reactive-manual/vue/range-components/dynamicrangeslider.html>

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ddionrails/publications/documents.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 """ Search documents for indexing models from ddionrails.publications app into Elasticsearch
4 
5 
6 Authors:
7     * 2019 Heinz-Alexander Fütterer (DIW Berlin)
8 
9 License:
10     | **AGPL-3.0 GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) 3.0**.
11     | See LICENSE at the GitHub
12       `repository <https://github.com/ddionrails/ddionrails/blob/master/LICENSE.md>`_
13     | or at
14       `<https://www.gnu.org/licenses/agpl-3.0.txt>`_.
15 """
16 
17 from django.conf import settings
18 from django.db.models import QuerySet
19 from django_elasticsearch_dsl import Document, fields
20 from django_elasticsearch_dsl.registries import registry
21 
22 from .models import Publication
23 
24 
25 @registry.register_document
26 class PublicationDocument(Document):
27     """ Search document for publications.Publication """
28 
29     # doc_type was removed in Elasticsearch 7
30     type = fields.KeywordField()
31 
32     @staticmethod
33     def prepare_type(publication: Publication) -> str:
34         return "publication"
35 
36     # facets
37     sub_type = fields.KeywordField()
38     study = fields.KeywordField()
39     year = fields.KeywordField()
40 
41     # prepare_FIELD will be executed while indexing FIELD
42     @staticmethod
43     def prepare_study(publication: Publication) -> str:
44         """ Return the related study """
45         return publication.study.title()
46 
47     class Index:  # pylint: disable=missing-docstring,too-few-public-methods
48         # Name of the Elasticsearch index
49         name = f"{settings.ELASTICSEARCH_DSL_INDEX_PREFIX}publications"
50 
51     class Django:  # pylint: disable=missing-docstring,too-few-public-methods
52         model = Publication  # The model associated with this Document
53 
54         # The fields of the model you want to be indexed in Elasticsearch
55         fields = ("abstract", "author", "cite", "doi", "name", "title", "url")
56 
57     def get_queryset(self) -> QuerySet:
58         """
59         Return the queryset that should be indexed by this doc type,
60         with select related study.
61         """
62         return super().get_queryset().select_related("study")
63
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ddionrails/publications/documents.py b/ddionrails/publications/documents.py
--- a/ddionrails/publications/documents.py
+++ b/ddionrails/publications/documents.py
@@ -36,7 +36,7 @@
     # facets
     sub_type = fields.KeywordField()
     study = fields.KeywordField()
-    year = fields.KeywordField()
+    year = fields.IntegerField()
 
     # prepare_FIELD will be executed while indexing FIELD
     @staticmethod

{"golden_diff": "diff --git a/ddionrails/publications/documents.py b/ddionrails/publications/documents.py\n--- a/ddionrails/publications/documents.py\n+++ b/ddionrails/publications/documents.py\n@@ -36,7 +36,7 @@\n     # facets\n     sub_type = fields.KeywordField()\n     study = fields.KeywordField()\n-    year = fields.KeywordField()\n+    year = fields.IntegerField()\n \n     # prepare_FIELD will be executed while indexing FIELD\n     @staticmethod\n", "issue": "Add dynamic range slider for publication year facet\nsee <https://opensource.appbase.io/reactive-manual/vue/range-components/dynamicrangeslider.html>\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\" Search documents for indexing models from ddionrails.publications app into Elasticsearch\n\n\nAuthors:\n    * 2019 Heinz-Alexander F\u00fctterer (DIW Berlin)\n\nLicense:\n    | **AGPL-3.0 GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) 3.0**.\n    | See LICENSE at the GitHub\n      `repository <https://github.com/ddionrails/ddionrails/blob/master/LICENSE.md>`_\n    | or at\n      `<https://www.gnu.org/licenses/agpl-3.0.txt>`_.\n\"\"\"\n\nfrom django.conf import settings\nfrom django.db.models import QuerySet\nfrom django_elasticsearch_dsl import Document, fields\nfrom django_elasticsearch_dsl.registries import registry\n\nfrom .models import Publication\n\n\n@registry.register_document\nclass PublicationDocument(Document):\n    \"\"\" Search document for publications.Publication \"\"\"\n\n    # doc_type was removed in Elasticsearch 7\n    type = fields.KeywordField()\n\n    @staticmethod\n    def prepare_type(publication: Publication) -> str:\n        return \"publication\"\n\n    # facets\n    sub_type = fields.KeywordField()\n    study = fields.KeywordField()\n    year = fields.KeywordField()\n\n    # prepare_FIELD will be executed while indexing FIELD\n    @staticmethod\n    def prepare_study(publication: Publication) -> str:\n        \"\"\" Return the related study \"\"\"\n        return publication.study.title()\n\n    class Index:  # pylint: disable=missing-docstring,too-few-public-methods\n        # Name of the Elasticsearch index\n        name = f\"{settings.ELASTICSEARCH_DSL_INDEX_PREFIX}publications\"\n\n    class Django:  # pylint: disable=missing-docstring,too-few-public-methods\n        model = Publication  # The model associated with this Document\n\n        # The fields of the model you want to be indexed in Elasticsearch\n        fields = (\"abstract\", \"author\", \"cite\", \"doi\", \"name\", \"title\", \"url\")\n\n    def get_queryset(self) -> QuerySet:\n        \"\"\"\n        Return the queryset that should be indexed by this doc type,\n        with select related study.\n        \"\"\"\n        return super().get_queryset().select_related(\"study\")\n", "path": "ddionrails/publications/documents.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\" Search documents for indexing models from ddionrails.publications app into Elasticsearch\n\n\nAuthors:\n    * 2019 Heinz-Alexander F\u00fctterer (DIW Berlin)\n\nLicense:\n    | **AGPL-3.0 GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) 3.0**.\n    | See LICENSE at the GitHub\n      `repository <https://github.com/ddionrails/ddionrails/blob/master/LICENSE.md>`_\n    | or at\n      `<https://www.gnu.org/licenses/agpl-3.0.txt>`_.\n\"\"\"\n\nfrom django.conf import settings\nfrom django.db.models import QuerySet\nfrom django_elasticsearch_dsl import Document, fields\nfrom django_elasticsearch_dsl.registries import registry\n\nfrom .models import Publication\n\n\n@registry.register_document\nclass PublicationDocument(Document):\n    \"\"\" Search document for publications.Publication \"\"\"\n\n    # doc_type was removed in Elasticsearch 7\n    type = fields.KeywordField()\n\n    @staticmethod\n    def prepare_type(publication: Publication) -> str:\n        return \"publication\"\n\n    # facets\n    sub_type = fields.KeywordField()\n    study = fields.KeywordField()\n    year = fields.IntegerField()\n\n    # prepare_FIELD will be executed while indexing FIELD\n    @staticmethod\n    def prepare_study(publication: Publication) -> str:\n        \"\"\" Return the related study \"\"\"\n        return publication.study.title()\n\n    class Index:  # pylint: disable=missing-docstring,too-few-public-methods\n        # Name of the Elasticsearch index\n        name = f\"{settings.ELASTICSEARCH_DSL_INDEX_PREFIX}publications\"\n\n    class Django:  # pylint: disable=missing-docstring,too-few-public-methods\n        model = Publication  # The model associated with this Document\n\n        # The fields of the model you want to be indexed in Elasticsearch\n        fields = (\"abstract\", \"author\", \"cite\", \"doi\", \"name\", \"title\", \"url\")\n\n    def get_queryset(self) -> QuerySet:\n        \"\"\"\n        Return the queryset that should be indexed by this doc type,\n        with select related study.\n        \"\"\"\n        return super().get_queryset().select_related(\"study\")\n", "path": "ddionrails/publications/documents.py"}]}