def test_filter_on_id_and_more(self):
        """Test various filtering scenarios including _id and other conditions"""
        # Adding documents
        self.add_documents(
            config=self.config,
            add_docs_params=AddDocsParams(
                index_name=self.default_text_index.name,
                docs=[
                    {"abc": "some text", "other_field": "baaadd", "_id": "5678", "status": "active"},
                    {"abc": "some text", "other_field": "Close match hehehe", "_id": "1234", "status": "inactive"},
                    {"abc": "different text", "other_field": "irrelevant", "_id": "9012", "status": "active"}
                ],
                tensor_fields=["abc", "other_field"]
            )
        )

        test_cases = [
            ("filter on id 5678", "_id:5678", 1, ["5678"]),
            ("filter on id 1234", "_id:1234", 1, ["1234"]),
            ("AND filter", "_id:5678 AND status:active", 1, ["5678"]),
            ("OR filter", "_id:5678 OR _id:1234", 2, ["5678", "1234"]),
            ("Complex filter", r"_id:5678 OR (abc:some\ text AND status:inactive)", 2, ["5678", "1234"]),
            ("Non-ID field filter", "status:active", 2, ["5678", "9012"]),
            ("No result filter", "_id:0000", 0, [])
        ]

        for name, filter_query, expected_count, expected_ids in test_cases:
            with self.subTest(name=name):
                res = tensor_search.search(
                    config=self.config, index_name=self.default_text_index.name, text="some text",
                    filter=filter_query
                )
                self.assertEqual(expected_count, len(res["hits"]))
                if expected_ids:
                    self.assertEqual(set(expected_ids), set([hit["_id"] for hit in res["hits"]]))
Test various filtering scenarios including _id and other conditions
tests/integ_tests/tensor_search/integ_tests/test_search_semi_structured.py