Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task] Add open-search config for ecommerce framework #604

Open
wants to merge 2 commits into
base: 2024.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"gotenberg/gotenberg-php": "^1.1 || ^2.0"
},
"suggest": {
"pimcore/elasticsearch-client": "Required for Elastic Search service"
"pimcore/elasticsearch-client": "Required for Elastic Search service",
"pimcore/opensearch-client": "Required for Open Search service"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions config/ecommerce/base-ecommerce.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
imports:
# - { resource: 'elastic-search.yaml' }
# - { resource: 'open-search.yaml' }

pimcore:
models:
Expand Down
256 changes: 256 additions & 0 deletions config/ecommerce/open-search.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
parameters:
index_service.attribute-search-analyzer-attribute-fields:
analyzed:
type: text
analyzer: "english"
search_analyzer: "english"
analyzed_ngram:
type: text
analyzer: app_ngram_analyzer
search_analyzer: app_whitespace_analyzer


pimcore_ecommerce_framework:
index_service:
tenants:
OpenSearch:
enabled: true
worker_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Worker\OpenSearch\DefaultOpenSearch
config_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Config\OpenSearch

placeholders:
'%%locale%%': 'en'

config_options:
opensearch_client_name: 'default'
client_config:
logging: true
indexName: 'pimcore-demo'

index_settings:
number_of_shards: 5
number_of_replicas: 0
max_ngram_diff: 30
analysis:
normalizer:
lowercase:
type: custom
filter:
- lowercase
analyzer:
app_ngram_analyzer:
tokenizer: app_ngram_tokenzier
filter:
- lowercase
app_whitespace_analyzer:
tokenizer: app_whitespace_tokenzier
filter:
- lowercase
tokenizer:
app_ngram_tokenzier:
type: ngram
min_gram: 3
max_gram: 25
token_chars: [letter, digit]
app_whitespace_tokenzier:
type: whitespace

search_attributes:
- name^3
- name.analyzed
- name.analyzed_ngram
- manufacturer_name^2
- manufacturer_name.analyzed
- manufacturer_name.analyzed_ngram
- color
- carClass
attributes:
name:
fieldname: productName
type: text
locale: '%%locale%%'
filter_group: string
options:
mapping:
type: text
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
manufacturer_name:
fieldname: 'manufacturer'
type: text
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\ObjectValue
interpreter_options:
target:
fieldname: name
locale: '%%locale%%'
filter_group: string
options:
mapping:
type: text
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
manufacturer:
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\DefaultObjects
filter_group: relation
bodyStyle:
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\DefaultObjects
filter_group: relation
carClass:
filter_group: string
options:
mapping:
type: keyword
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
color:
filter_group: multiselect
options:
mapping:
type: keyword
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
country:
type: keyword
filter_group: string
milage:
type: double
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\QuantityValue
interpreter_options:
onlyValue: true
getter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Getter\DefaultBrickGetterSequence
getter_options:
source:
- brickfield: saleInformation
bricktype: SaleInformation
fieldname: milage
filtergroup: double

length:
type: keyword
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\QuantityValue
interpreter_options:
onlyValue: true
getter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Getter\DefaultBrickGetterSequence
getter_options:
source:
- brickfield: attributes
bricktype: dimensions
fieldname: length
filtergroup: double

width:
type: double
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\QuantityValue
interpreter_options:
onlyValue: true
getter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Getter\DefaultBrickGetterSequence
getter_options:
source:
- brickfield: attributes
bricktype: dimensions
fieldname: width
filtergroup: double
wheelbase:
type: double
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\QuantityValue
interpreter_options:
onlyValue: true
getter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Getter\DefaultBrickGetterSequence
getter_options:
source:
- brickfield: attributes
bricktype: dimensions
fieldname: wheelbase
filtergroup: double
weight:
type: double
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\QuantityValue
interpreter_options:
onlyValue: true
getter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Getter\DefaultBrickGetterSequence
getter_options:
source:
- brickfield: attributes
bricktype: dimensions
fieldname: weight
filtergroup: double

power:
type: double
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\QuantityValue
interpreter_options:
onlyValue: true
getter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Getter\DefaultBrickGetterSequence
getter_options:
source:
- brickfield: attributes
bricktype: engine
fieldname: power
filtergroup: double


segments:
getter_id: App\Ecommerce\IndexService\SegmentGetter
interpreter_id: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\DefaultObjects
filter_group: relation

# sample configuration for classification store attributes filter
# classificationstore:
# fieldname: 'cl'
# interpreter: Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\Interpreter\DefaultClassificationStore
# filtergroup: classificationstore
# options:
# mapping:
# type: 'object'
# properties:
# keys:
# type: 'long'
# values:
# type: 'object'


filter_service:
tenants:
OpenSearch:
filter_types:
FilterInputfield:
# Service id for filter type implementation
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\Input
# Default template for filter, can be overwritten in filter definition
template: 'product/filters/input.html.twig'

FilterNumberRange:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\NumberRange
template: 'product/filters/numberrange.html.twig'

FilterNumberRangeSelection:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\NumberRangeSelection
template: 'product/filters/numberrange_select.html.twig'

FilterSelect:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\Select
template: 'product/filters/select.html.twig'

FilterSelectFromMultiSelect:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\SelectFromMultiSelect
template: 'product/filters/select.html.twig'

FilterMultiSelect:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\MultiSelect
template: 'product/filters/multi_select.html.twig'

FilterMultiSelectFromMultiSelect:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\MultiSelectFromMultiSelect
template: 'product/filters/multi_select.html.twig'

FilterMultiRelation:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\MultiSelectRelation
template: 'product/filters/multi_relation.html.twig'

FilterCategory:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\SelectCategory
template: 'product/filters/select_category.html.twig'

FilterRelation:
filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\SelectRelation
template: 'product/filters/object_relation.html.twig'

# FilterSelectClsStoreAttributes:
# filter_type_id: Pimcore\Bundle\EcommerceFrameworkBundle\FilterService\FilterType\SearchIndex\SelectClassificationStoreAttributes
# template: 'product/filters/nested_attributes.html.twig'
Loading