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=[
                            {"text_field_1": "Exact match hehehe efgh ",
                             "text_field_2": "baaadd efgh ",
                             "text_field_3": "some field efgh ",
                             "_id": "5678"},
                            {"text_field_1": "shouldn't really match ",
                             "text_field_2": "Nope.....",
                             "text_field_3": "Random text here efgh ",
                             "_id": "1234"},
                        ]
                    )
                )
                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_structured.py