def METHOD_NAME(
    community, record_community, service, anyuser_identity, uploader
):
    """Test search for records in a community."""
    results = service.search(
        anyuser_identity,
        community_id=str(community.id),
    )
    assert results.to_dict()["hits"]["total"] == 0
    record_community.create_record()
    record_community.create_record()
    record_community.create_record()
    for identity in [anyuser_identity, uploader.identity]:
        results = service.search(
            identity,
            community_id=str(community.id),
        )
        assert results.to_dict()["hits"]["total"] == 3