Field data type for multi_match query with type phrase

Hello,

I have the following query:

{
    "size": 40,
    "from": 0,
    "query": {
        "bool": {
            "must": [
                {
                    "multi_match": {
                        "query": "my search",
                        "fields": [
                            "title",
                            "actors.name",
                            "producer.name",
                            "categories.name",
                            "tags.name"
                        ],
                        "type": "best_fields",
                        "tie_breaker": 0.3
                    }
                }
            ],
            "should": [
                {
                    "multi_match": {
                        "query": "my search",
                        "fields": [
                            "title^6",
                            "actors.name^5",
                            "producer.name^4",
                            "categories.name^3",
                            "tags.name^2"
                        ],
                        "type": "phrase"
                    }
                }
            ],
            "filter": [
                {
                    "bool": {
                        "must": [
                            {
                                "term": {
                                    "segment": 1
                                }
                            }
                        ]
                    }
                }
            ]
        }
    }
}

Should I use search on the fields keyword or leave it as it is by default

{
    "size": 40,
    "from": 0,
    "query": {
        "bool": {
            ...
            "should": [
                {
                    "multi_match": {
                        "query": "my search",
                        "fields": [
                            "title.keyword^6",
                            "actors.name.keyword^5",
                            "producer.name.keyword^4",
                            "categories.name.keyword^3",
                            "tags.name.keyword^2"
                        ],
                        "type": "phrase"
                    }
                }
            ],
            ...
        }
    }
}

Thanks for your help.

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