def test_concurrent_partial_update_requests_on_numeric_fields(self):
        """Test concurrent updates to different fields of the same document.

        This test verifies that:
        1. Multiple threads can update different fields of the same document concurrently
        2. Updates are properly applied without conflicts
        3. The final document state reflects one of the updates correctly
        """
        # First add a document to update
        text_docs = [{
            '_id': '3',
            'tensor_field': 'concurrent update test',
            'description': 'This document will be updated by multiple threads',
            'int_field': 100,
            'float_field': 100.0,
        }]

        add_docs_response = self.client.index(self.text_index_name).add_documents(documents=text_docs, mappings={},
                                                                                  tensor_fields=['tensor_field',
                                                                                                 'description'])
        self.assertFalse(add_docs_response["errors"])

        def update_rank_thread(index_name, rank_values):
            for i, new_rank in enumerate(rank_values):
                timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
                print(f"[{timestamp}] Rank update {i + 1}/{len(rank_values)}: Setting rank to {new_rank}")
                r = self.client.index(index_name).update_documents([{'_id': '3', 'rank': new_rank}])
                timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
                print(f"[{timestamp}] Rank update {i + 1} complete. Response: {r}")
                self.assertFalse(r["errors"]) # Assert that there are no errors in the response
                time.sleep(0.5)  # Small delay between updates

        def update_popularity_thread(index_name, popularity_values):
            for i, new_pop in enumerate(popularity_values):
                timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
                print(
                    f"[{timestamp}] Popularity update {i + 1}/{len(popularity_values)}: Setting popularity to {new_pop}")
                r = self.client.index(index_name).update_documents([{'_id': '3', 'popularity': new_pop}])
                timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
                print(f"[{timestamp}] Popularity update {i + 1} complete. Response: {r}")
                self.assertFalse(r["errors"]) # Assert that there are no errors in the response
                time.sleep(0.5)  # Same delay now for both threads

        rank_values = [0.85, 0.87, 0.90, 0.82, 0.88]
        popularity_values = [0.72, 0.75, 0.79, 0.81, 0.78]

        rank_thread = threading.Thread(target=update_rank_thread, args=(self.text_index_name, rank_values))
        pop_thread = threading.Thread(target=update_popularity_thread, args=(self.text_index_name, popularity_values))

        rank_thread.start()
        pop_thread.start()

        rank_thread.join()
        pop_thread.join()

        print(f"[{datetime.now().strftime('%H:%M:%S.%f')[:-3]}] Both updates completed")

        # Get the document to verify updates
        updated_doc = self.client.index(self.text_index_name).get_document(document_id='3')

        # Check that only one of the fields is present (due to concurrent updates)
        has_rank = 'rank' in updated_doc
        has_popularity = 'popularity' in updated_doc

        # Either rank or popularity should be present, but not both
        self.assertTrue(has_rank and has_popularity, "Neither rank nor popularity field is present")

        # If rank is present, verify it's one of the rank values
        self.assertIn(updated_doc['rank'], rank_values,
                      f"Rank value {updated_doc['rank']} is not in expected values {rank_values}")

        # If popularity is present, verify it's one of the popularity values
        self.assertIn(updated_doc['popularity'], popularity_values,
                          f"Popularity value {updated_doc['popularity']} is not in expected values {popularity_values}")

        # Verify original fields are still intact
        self.assertEqual(updated_doc['tensor_field'], 'concurrent update test')
        self.assertEqual(updated_doc['description'], 'This document will be updated by multiple threads')
        self.assertEqual(updated_doc['int_field'], 100)
        self.assertEqual(updated_doc['float_field'], 100.0)

        # Test search with score modifiers using the updated field (whichever is present)
        base_search_result = self.client.index(self.text_index_name).search("concurrent update")
        base_score = base_search_result["hits"][0]["_score"]

        search_result = self.client.index(self.text_index_name).search("concurrent update", score_modifiers={
            "add_to_score": [{"field_name": "rank", "weight": 1}]
        })

        self.assertTrue(len(search_result["hits"]) > 0, "No search results found")
        hit = search_result["hits"][0]
        self.assertAlmostEqual(hit["_score"], base_score + 1 * updated_doc['rank'], places=5)

        search_result = self.client.index(self.text_index_name).search("concurrent update", score_modifiers={
            "add_to_score": [{"field_name": "popularity", "weight": 1}]
        })

        self.assertTrue(len(search_result["hits"]) > 0, "No search results found")
        hit = search_result["hits"][0]
        self.assertAlmostEqual(hit["_score"], base_score + 1 * updated_doc['popularity'], places=5)
Test concurrent updates to different fields of the same document.

        This test verifies that:
        1. Multiple threads can update different fields of the same document concurrently
        2. Updates are properly applied without conflicts
        3. The final document state reflects one of the updates correctly
        
tests/api_tests/v1/tests/api_tests/unstructured_index/test_update_documents_unstructured_index.py