Find comparison result from multi value field


#1

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?


(system) #2

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