def topic_maggs_query_phraseMatch(subjects):
    """
    Creates a aggregation query "topicAM" which produces a
    adjacency matrix with different subject correlations in its
    fields.
    :param list subjects - list of subjects

    :returns: tuple of aggregation name together with aggregation query
    to use with elasticsearch
    """

    query = {
            "size": 0,
            "aggs": {
                "topicAM": {
                    "adjacency_matrix": {
                        "filters": {
                            subj: {
                                "multi_match": {
                                    "query": subj,
                                    "fields": [
                                        "preferredName",
                                        "description",
                                        "nameShort",
                                        "nameSub",
                                        "mentions.name",
                                        "partOfSeries.name",
                                        "about.name",
                                        "about.keywords"
                                    ],
                                    "type": "phrase"
                                }
                            }
                            for subj in subjects
                        }
                    }
                }
            }
        }
    return query