def test_partial_document_update(self):
        """
        Test that partial document update works for a map score modifier.
        """
        test_cases = [self.structured_index_name]

        for test_index_name in test_cases:
            with (self.subTest(test_index_name)):
                # Add document
                docs = [
                    {"_id": "1", "text_field": "a photo of a cat", "map_score_mods": {"a": 0.5}},
                    {"_id": "2", "text_field": "a photo of a dog", "map_score_mods": {"b": 0.5}},
                    {"_id": "3", "text_field": "a photo of a cat", "map_score_mods": {"c": 0.5}},
                    {"_id": "4", "text_field": "a photo of a cat", "map_score_mods_int": {"a": 1}},
                    {"_id": "5", "text_field": "a photo of a cat", "map_score_mods_int": {"b": 1}},
                    {"_id": "6", "text_field": "a photo of a cat", "map_score_mods_int": {"c": 1}},
                    {"_id": "7", "text_field": "a photo of a cat", "map_score_mods_int": {"c": 1},
                     "map_score_mods": {"a": 0.5}},
                ]

                # Add documents
                res = self.client.index(test_index_name).add_documents(documents=docs)

                # Get document and assert that the score modifier is 0.5
                res = self.client.index(test_index_name).get_documents(
                    document_ids=["1"]
                )
                self.assertTrue(res["results"][0]["_id"] == "1")
                self.assertTrue(res["results"][0]["map_score_mods"]["a"] == 0.5)

                # Update the document
                res = self.client.index(test_index_name).update_documents(
                    documents=[{"_id": "1", "map_score_mods": {"a": 1.5}}]
                )

                # Fetch Document
                res = self.client.index(test_index_name).get_documents(
                    document_ids=["1"]
                )

                # Assert that the document has been updated
                self.assertTrue(res["results"][0]["_id"] == "1")
                self.assertTrue(res["results"][0]["map_score_mods"]["a"] == 1.5)

                # Search with score modifiers
                # 0.68 + 1.5 * 2 = 3.88
                res = self.client.index(test_index_name).search(
                    q="",
                    score_modifiers={
                        "add_to_score": [{"field_name": "map_score_mods.a", "weight": 2}],
                    }
                )
                # Assert that the first result is  1
                first_result_id = res["hits"][0]["_id"]
                self.assertTrue(first_result_id in ["1"])

                # Assert that 3 <= _score <= 4
                first_result_score = res["hits"][0]["_score"]
                self.assertTrue(3 <= first_result_score <= 4)

        Test that partial document update works for a map score modifier.
        
tests/api_tests/v1/tests/api_tests/test_dict_score_modifiers.py