BitBagCommerce / SyliusVueStorefrontPlugin

Sylius plugin integrating Sylius with Vue Storefront
45 stars 24 forks source link

Unknown key for a START_ARRAY in [_availableFilters] #125

Closed andrei1152 closed 1 year ago

andrei1152 commented 3 years ago

When VueStorefront does a http://localhost:8000/vsbridge/catalog/vue_storefront_catalog/product/_search request , the backend throws an exception with the following message: Elastica\Exception\ResponseException: "Unknown key for a START_ARRAY in [_availableFilters]

Looking into the query params of the request, I notice there's a section request: {"_availableFilters":[],"_appliedFilters":[{"attribute":"new","value":{"eq":1},"scope":"default"},{"attribute":"visibility","value":{"in":[2,3,4]},"scope":"default"},{"attribute":"status","value":{"in":[0,1]},"scope":"default"}],"_appliedSort":[{"field":"created_at","options":"desc"}],"_searchText":""}

Am I missing something here? ElasticSearch version is 6.8.13

nickvanderzwet commented 3 years ago

I'm facing the same problem, did you already found a solution? Maybe it has to do with the local.json file used in VSF? Did you modified it based on your data in Sylius?

plotkabytes commented 3 years ago

Do you use capybara theme @andrei1152 @nickvanderzwet ? I had the same problem after installing capybara theme and solved it by modyfing local.json. Capybara installation guide includes generation of local.json file from script generate-local-config.js. If you look inside generated file you will find following lines:

"server": { "api": "api-search-query" },

When modyfing mine local.json file for capybara theme I've changed this line to: "server": { "api": "api" },

And now everything works fine. As far as I read the capybara theme uses another search adapter which seems to be not supported by SyliusVueStorefrontPlugin for now.

andrei1152 commented 3 years ago

@nickvanderzwet in my case I've solved it by using the default theme instead of Capybara. But @plotkabytes solution seems more interesting