Liferay supports Elasticsearch 7. The compatibility matrix provides the latest support details.
Elasticsearch 6.x is not supported on Liferay 7.3+.
Before planning your upgrade, read Upgrading Search Infrastructure. It provides an overview of the steps required to upgrade older Liferay/Elasticsearch systems to the latest supported search stack. Always back up your search indexes before upgrading Elasticsearch.