def METHOD_NAME(request):
    """
    Search for users by various criteria.
    Args:
        request (pyramid.request): The current web request.
    Returns:
        dict: A dictionary with the follow key mappings:
            users: A list of users matching the search criteria.
            page: The current page of results.
            pages: The total number of pages available.
            rows_per_page: The number of users on the page.
            total: The total number of users matching the search criteria.
    """
    db = request.db
    data = request.validated
    query = db.query(User)
    like = data.get('like')
    if like is not None:
        query = query.filter(or_(*[
            User.name.like('%%%s%%' % like)
        ]))
    search = data.get('search')
    if search is not None:
        query = query.filter(User.name.ilike('%%%s%%' % search))
    name = data.get('name')
    if name is not None:
        query = query.filter(User.name.like(name))
    groups = data.get('groups')
    if groups is not None:
        query = query.join(User.groups)
        query = query.filter(or_(*[Group.id == grp.id for grp in groups]))
    updates = data.get('updates')
    if updates is not None:
        query = query.join(User.updates)
        args = [Update.alias == update.alias for update in updates]
        query = query.filter(or_(*args))
    # We can't use ``query.count()`` here because it is naive with respect to
    # all the joins that we're doing above.
    count_query = query.set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL).statement\
        .with_only_columns(func.count(distinct(User.id)))\
        .order_by(None)
    total = request.db.execute(count_query).scalar()
    page = data.get('page')
    rows_per_page = data.get('rows_per_page')
    pages = int(math.ceil(total / float(rows_per_page)))
    query = query.offset(rows_per_page * (page - 1)).limit(rows_per_page)
    return dict(
        users=query.all(),
        page=page,
        pages=pages,
        rows_per_page=rows_per_page,
        total=total,
    )