magento2-vsbridge-indexer
magento2-vsbridge-indexer copied to clipboard
Product Category Name missing Type Keyword?
Category Filtering on VSF home page didn't seem to work with the default indexer install using category.name.keyword
on default.json file in VSF
Seems like the product category needs to be changed to TYPE_KEYWORD
on magento2-vsbridge-indexer/src/module-vsbridge-indexer-catalog/Index/Mapping/Product.php
From lines 220:
'category' => [
'type' => 'nested',
'properties' => [
'category_id' => ['type' => FieldInterface::TYPE_LONG],
'position' => ['type' => FieldInterface::TYPE_LONG],
'name' => ['type' => FieldInterface::TYPE_TEXT],
],
],
To
'category' => [
// 'type' => 'nested',
'properties' => [
'category_id' => ['type' => FieldInterface::TYPE_LONG],
'position' => ['type' => FieldInterface::TYPE_LONG],
'name' => [
'type' => FieldInterface::TYPE_TEXT,
'fields' => [
'keyword' => [
'type' => FieldInterface::TYPE_KEYWORD,
'ignore_above' => 256
]
]
]
]
],
This worked for me for vsf 1.8-1.9
Seems fixed in version 1.1.0
Hi @tonyisworking , Yes I change mapping but you still need to make changes in VSF to make it work. "category" field has a nested type (so we can use sorting by position) and normal query won't work. You have to create nested query to ES.
We have two option here:
- We might add the option to indexer to create category as nested type or not. (but then you can't use sorting by category position).
- Changes to VSF core might be required to switch query, base on the configuration.
@pkarw what do you think ? Option 1 Can we change the mapping for "category" field to nested type in vsf-api/maget2vsf schemas and create nested filters queries?
Option 2
I can add a new configuration to vsf
category.nested-type: true/false
-> and base on this we will make nested query or not.
Probably option 2 will be better so make it compatible with the previous versions.
@afirlejczyk backward compatibility is our priority
whoops, yeah it wasn't working, closed out too early. I was on my own fork...