# Find comparison result from multi value field

**URL:** <https://discuss.elastic.co/t/find-comparison-result-from-multi-value-field/136790>\
**Category:** Elasticsearch\
**Created:** [June 21, 2018, 6:29am UTC](https://discuss.elastic.co/t/find-comparison-result-from-multi-value-field/136790 "2018-06-21T06:29:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewHere](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@NewHere](https://discuss.elastic.co/u/NewHere)\
**Post date:** [June 21, 2018, 6:29am UTC](https://discuss.elastic.co/t/find-comparison-result-from-multi-value-field/136790/1 "2018-06-21T06:29:17Z")

</div>

Hello, this is very difficult to me and would love to get some directions. Say I have a multi-value field `"tags": ["elasticsearch", "elastic search"]`, in the index, I have already separated it into multiple field types, like:

```
"tags": {
    "type": "text",
    "fields": {
        "partial": {
            "type": "text",
            "analyzer": "my_edge_ngram",
        },
        "raw": {
            "type": "keyword"
        }
    },
}

```

so that I can issue queries for `tags` (analysed), `tags.partial` (partial) and `tags.raw` (exact).

What I want to achieve is to compare my searching text and find out if it is an exact/partial/analysed match. e.g. if I search for "elastic", I will issue a query with three named sub queries, then from the `SearchHit.matchedQueries` I can figure out the comparison result.

The above works well when the field being compared is a single value field. But when the field is a multi value field (e.g. `tags` in the example above), how do you get the comparison results against each single value within the multi value field and get individual results back in `SearchHit.matchedQueries`?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 19, 2018, 6:29am UTC](https://discuss.elastic.co/t/find-comparison-result-from-multi-value-field/136790/2 "2018-07-19T06:29:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
