### Description

Going to Airflow web UI, Browse>DAG Run displays the list of runs, but there is no way to search or filter based on the text in the "Note" column.

### Use case/motivation

It is possible to do a free text search for the "Run Id" field. The Note field may contain pieces of information that may be relevant to find, or to filter on the basis of these notes.

### Related issues

Sorting by Note in List Dag Run fails: 
https://github.com/apache/airflow/issues/30041

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

"""
    Return a dict of the task quantity, grouped by dag id and task status.
    :param qry: The data in the format (<dag id>, <task state>, <is dag running>, <task count>),
        ordered by <dag id> and <is dag running>
    """
    data = {}
    last_dag_id = None
    has_running_dags = False
    for dag_id, state, is_dag_running, count in qry:
        if last_dag_id != dag_id:
            last_dag_id = dag_id
            has_running_dags = False
        elif not is_dag_running and has_running_dags:
            continue
        if is_dag_running:
            has_running_dags = True
        if dag_id not in data:
            data[dag_id] = {}
        data[dag_id][state] = count
    return data
def redirect_or_json(origin, msg, status="", status_code=200):