def test_non_number_facet_with_ranges_fails(self):
        """Test that ranges are only allowed for number facets"""
        for facet_type in ["string", "array"]:
            with self.assertRaises(MarqoWebError) as e:
                self.client.index(self.unstructured_text_index_name).search(
                    "shirt",
                    search_method="HYBRID",
                    facets={
                        "fields": {
                            "color": {
                                "type": facet_type,
                                "ranges": [
                                    {"from": 0, "to": 50}
                                ]
                            }
                        }
                    }
                )
            self.assertIn("Ranges can only be used for 'number' facets", str(e.exception))
Test that ranges are only allowed for number facets
tests/api_tests/v1/tests/api_tests/unstructured_index/test_facets.py