diff --git a/elasticsearch_dsl/analysis.py b/elasticsearch_dsl/analysis.py
index 8424283..c2abd94 100644
--- a/elasticsearch_dsl/analysis.py
+++ b/elasticsearch_dsl/analysis.py
@@ -19,9 +19,9 @@ class AnalysisBase(object):
 
 class CustomAnalysis(object):
     name = 'custom'
-    def __init__(self, name, builtin_type='custom', **kwargs):
+    def __init__(self, filter_name, builtin_type='custom', **kwargs):
         self._builtin_type = builtin_type
-        self._name = name
+        self._name = filter_name
         super(CustomAnalysis, self).__init__(**kwargs)
 
     def to_dict(self):
diff --git a/elasticsearch_dsl/faceted_search.py b/elasticsearch_dsl/faceted_search.py
index 795132f..129b4fc 100644
--- a/elasticsearch_dsl/faceted_search.py
+++ b/elasticsearch_dsl/faceted_search.py
@@ -145,7 +145,8 @@ class DateHistogramFacet(Facet):
             # so we need to set key to 0 to avoid TypeError exception
             if bucket['key'] is None:
                 bucket['key'] = 0
-            return datetime.utcfromtimestamp(int(bucket['key']) / 1000)
+            # Preserve milliseconds in the datetime
+            return datetime.utcfromtimestamp(int(bucket['key']) / 1000.0)
         else:
             return bucket['key']
 
diff --git a/elasticsearch_dsl/field.py b/elasticsearch_dsl/field.py
index 129b53c..d895e7e 100644
--- a/elasticsearch_dsl/field.py
+++ b/elasticsearch_dsl/field.py
@@ -218,7 +218,8 @@ class Date(Field):
         if isinstance(data, date):
             return data
         if isinstance(data, int):
-            return datetime.utcfromtimestamp(data / 1000)
+            # Divide by a float to preserve milliseconds on the datetime.
+            return datetime.utcfromtimestamp(data / 1000.0)
 
         try:
             # TODO: add format awareness

Datetimes dropping miliseconds
The problems causes dates like '1970-01-01T00:17:47.045Z' in ElasticSearch to end up as a datetime like
datetime.datetime(1970, 1, 1, 0, 17, 47)                                                                                        

My expectation is that this value should produce a datetime like
datetime.datetime(1970, 1, 1, 0, 17, 47, 45000)

https://github.com/elastic/elasticsearch-dsl-py/blob/269fef7fa12333f7622c3694df75a1b296d87ae2/elasticsearch_dsl/field.py#L221

This is caused by integer division on the line referenced above. Changing this line to divide by 1000.0 fixes the issue. 



diff --git a/test_elasticsearch_dsl/test_analysis.py b/test_elasticsearch_dsl/test_analysis.py
index 014c43d..6dc3c09 100644
--- a/test_elasticsearch_dsl/test_analysis.py
+++ b/test_elasticsearch_dsl/test_analysis.py
@@ -79,3 +79,11 @@ def test_custom_analyzer_can_collect_custom_items():
         }
     } == a.get_analysis_definition()
 
+def test_stemmer_analyzer_can_pass_name():
+    t = analysis.token_filter('my_english_filter', name="minimal_english", type="stemmer")
+    assert t.to_dict() == 'my_english_filter'
+    assert {
+        "type" : "stemmer",
+        "name" : "minimal_english"
+    } == t.get_definition()
+

pip install -e .[develop]
parse_log_pytest
pytest
pytest pytest-cov pytz
apt-get update apt-get install -y gcc
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
docutils==0.18.1
elasticsearch==5.5.3
-e git+https://github.com/elastic/elasticsearch-dsl-py.git@269fef7fa12333f7622c3694df75a1b296d87ae2#egg=elasticsearch_dsl
idna==3.10
imagesize==1.4.1
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
Jinja2==3.0.3
MarkupSafe==2.0.1
mock==5.2.0
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
Pygments==2.14.0
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-cov==4.0.0
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tomli==1.2.3
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
urllib3==1.26.20
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: elasticsearch-dsl-py
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - docutils==0.18.1
      - elasticsearch==5.5.3
      - idna==3.10
      - imagesize==1.4.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mock==5.2.0
      - pygments==2.14.0
      - pytest-cov==4.0.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - urllib3==1.26.20
prefix: /opt/conda/envs/elasticsearch-dsl-py

test_elasticsearch_dsl/test_analysis.py::test_stemmer_analyzer_can_pass_name
test_elasticsearch_dsl/test_analysis.py::test_analyzer_serializes_as_name test_elasticsearch_dsl/test_analysis.py::test_analyzer_has_definition test_elasticsearch_dsl/test_analysis.py::test_normalizer_serializes_as_name test_elasticsearch_dsl/test_analysis.py::test_normalizer_has_definition test_elasticsearch_dsl/test_analysis.py::test_tokenizer test_elasticsearch_dsl/test_analysis.py::test_custom_analyzer_can_collect_custom_items
elasticsearch_dsl/field.py elasticsearch_dsl/faceted_search.py elasticsearch_dsl/analysis.py
elasticsearch_dsl/field.py elasticsearch_dsl/faceted_search.py elasticsearch_dsl/analysis.py