def test_filter_range_number(
    os_stores: List[OpensearchVectorStore],
    insert_document,
    operator: FilterOperator,
    exp_doc_ids: set,
):
    """Test that OpensearchVectorStore correctly applies FilterOperator.GT/GTE/LT/LTE in filters for numbers."""
    for os_store in os_stores:
        for i in range(1, 5):
            insert_document(os_store, doc_id=f"page{i}", metadata={"page": i})
        insert_document(os_store, doc_id="nomatch", metadata={})

        query = _get_sample_vector_store_query(
            filters=MetadataFilters(
                filters=[MetadataFilter(key="page", value=2, operator=operator)]
            )
        )
        query_result = os_store.query(query)

        doc_ids = {node.id_ for node in query_result.nodes}
        assert doc_ids == exp_doc_ids
Test that OpensearchVectorStore correctly applies FilterOperator.GT/GTE/LT/LTE in filters for numbers.
llama-index-integrations/vector_stores/llama-index-vector-stores-opensearch/tests/test_opensearch_client.py