[search] Can not connect the vue-storefront-api / ElasticSearch instance!

Hi there,
I have installed the VueStorefront API and made the import from Magento but when I run yarn dev on my frontend instance I get this error and the message: “Something went wrong”.

  [search] Can not connect the vue-storefront-api / ElasticSearch instance! Error: {"code":500,"result":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/vue_storefront_catalog/attribute/_search] contains unrecognized parameter: [_source_include] -> did you mean any of [_source_includes, _source_excludes]?"}],"type":"illegal_argument_exception","reason":"request [/vue_storefront_catalog/attribute/_search] contains unrecognized parameter: [_source_include] -> did you mean any of [_source_includes, _source_excludes]?"}}
    at SearchAdapter.exports.modules../core/lib/search/adapter/api/searchAdapter.ts.SearchAdapter.handleResult (vsf-search-adapter-api-searchAdapter.server-bundle.js:183:23)
    at Object.resultProcessor (vsf-search-adapter-api-searchAdapter.server-bundle.js:221:30)
    at server-bundle.js:4297:92
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:47390) UnhandledPromiseRejectionWarning: Error: {"code":500,"result":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/vue_storefront_catalog/attribute/_search] contains unrecognized parameter: [_source_include] -> did you mean any of [_source_includes, _source_excludes]?"}],"type":"illegal_argument_exception","reason":"request [/vue_storefront_catalog/attribute/_search] contains unrecognized parameter: [_source_include] -> did you mean any of [_source_includes, _source_excludes]?"}}
(Use `node --trace-warnings ...` to show where the warning was created)
(node:47390) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 46)

Can someone help please? Thank you!

Node v14.15.4, ElasticSeach v7.10.0, apiVersion 5.6, docker-compose v1.27.4, yarn v1.22.10

Hello,
the problem is caused by bad apiVersion in the config of your VSF-API. apiVersion setting should match ElasticSearch version. So in your case, just change value of apiVersion from 5.6 to 7.10

1 Like

Thank you @Fifciuu it worked.