def test_hybrid_search_with_filter(self):
        """
        Tests that filter is applied correctly in hybrid search.
        """

        for index_name in [self.text_index_name, self.unstructured_text_index_name]:
            with self.subTest(index=index_name):
                self.client.index(index_name).add_documents(
                    self.docs_list,
                    tensor_fields=["text_field_1", "text_field_2", "text_field_3"] \
                        if "unstructured" in index_name else None
                )

                test_cases = [
                    ("disjunction", "rrf"),
                    ("lexical", "lexical"),
                    ("tensor", "tensor")
                ]

                for retrievalMethod, rankingMethod in test_cases:
                    with self.subTest(retrieval=retrievalMethod, ranking=rankingMethod):
                        hybrid_res = self.client.index(index_name).search(
                            "dogs",
                            search_method="HYBRID",
                            filter_string="text_field_1:(something something dogs)",
                            hybrid_parameters={
                                "retrievalMethod": retrievalMethod,
                                "rankingMethod": rankingMethod
                            },
                            limit=10
                        )

                        self.assertEqual(len(hybrid_res["hits"]), 1)
                        self.assertEqual(hybrid_res["hits"][0]["_id"], "doc8")

        Tests that filter is applied correctly in hybrid search.
        
tests/api_tests/v1/tests/api_tests/structured_index/test_hybrid_search.py