Upgrade version from 2 to 7

I moved site to new server, and my new elastic version is 7.9.2 and old version is 2.3.5
I use this command to move indexes

elasticdump --input=http://localhost:9200/nut_uk --output=nut_uk_mapping.json   --type=mapping
elasticdump --input=http://localhost:9200/nut_uk --output=nut_uk_data.json   --type=data

after backup I edited nut_uk_mapping.json before import to new server. Then I update elastic lib and edit search query
old query is

return [
            'filtered' => [
                'query' => [
                    'multi_match' => [
                        'query' => $queryString ?? '',
                        'type' => 'best_fields',
                        'minimum_should_match' => '90%',
                        'fields' => [
                            'label^3',
                            'content^2',
                            'builder_content^2',
                        ]
                    ],
                ],
                'filter' => [
                    'bool' => [
                        'must' => [
                            ['term' => ['language' => \Yii::$app->language]],
                            ['term' => ['published' => 1]],
                        ],
                    ],
                ],
            ]
        ];

new is

 return [
            'bool' => [
                'must' => [
                    'multi_match' => [
                        'query' => $queryString ?? '',
                        'type' => 'best_fields',
                        'minimum_should_match' => '90%',
                        'fields' => [
                            'label^3',
                            'content^2',
                            'builder_content^2',
                        ]
                    ],
                ],
                'filter' => [
                    'bool' => [
                        'must' => [
                            ['term' => ['language' => \Yii::$app->language]],
                            ['term' => ['published' => 1]],
                        ],
                    ],
                ],
            ]
        ];

but the problem is it search nothing, old server search worked. what the problem?

Welcome!

Not enough details here but I'd first check the mappings.

If you can't find what is happening, could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Have a look at the Elastic Stack and Solutions Help · Forums and Slack | Elastic page. It contains also lot of useful information on how to ask for help.

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