def test_each_doc_returned_once(self):
        """Each doc should be returned once, even if it matches multiple times"""
        tests = [
            (self.default_text_index, 'Standard index name'),
            (self.default_text_index_encoded_name, 'Index name requiring encoding'),
        ]
        for index_name, desc in tests:
            with self.subTest(desc):
                self.add_documents(config=self.config,
                                   add_docs_params=AddDocsParams(
                                       index_name=index_name,
                                       docs=[
                                           {"abc": "Exact match hehehe efgh ", "other_field": "baaadd efgh ",
                                            "_id": "5678", "finally": "some field efgh "},
                                           {"abc": "shouldn't really match ", "other_field": "Nope.....",
                                            "_id": "1234", "finally": "Random text here efgh "},
                                       ],
                                       tensor_fields=["abc", "other_field", "finally"],
                                   )
                                   )

                index_object = index_meta_cache.get_index(self.index_management, self.default_text_index)
                search_res = tensor_search._vector_text_search(
                    config=self.config,
                    query=" efgh ", result_count=10, device="cpu",
                    marqo_index=index_object
                )
                assert len(search_res['hits']) == 2
Each doc should be returned once, even if it matches multiple times
tests/integ_tests/tensor_search/integ_tests/test_search_unstructured.py