Skip to content

Commit

Permalink
optimized mapping & search
Browse files Browse the repository at this point in the history
  • Loading branch information
fashxp committed Jun 8, 2020
1 parent 176421d commit 32f81de
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
39 changes: 23 additions & 16 deletions app/config/ecommerce/elastic-search.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
parameters:
index_service.attribute-search-analyzer-attributes:
type: text
fields:
analyzed:
type: text
analyzer: "english"
search_analyzer: "english"
analyzed_ngram:
type: text
analyzer: app_ngram_analyzer
search_analyzer: app_whitespace_analyzer
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:
Expand Down Expand Up @@ -76,7 +74,9 @@ pimcore_ecommerce_framework:
locale: '%%locale%%'
filter_group: string
options:
mapping: '%index_service.attribute-search-analyzer-attributes%'
mapping:
type: text
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
manufacturer_name:
fieldname: 'manufacturer'
type: text
Expand All @@ -87,23 +87,30 @@ pimcore_ecommerce_framework:
locale: '%%locale%%'
filter_group: string
options:
mapping: '%index_service.attribute-search-analyzer-attributes%'
mapping:
type: text
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
price_field:
type: double
getter_id: AppBundle\Ecommerce\IndexService\PriceGetter
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:
type: keyword
filter_group: string
options:
mapping:
type: keyword
normalizer: lowercase
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
color:
type: keyword
filter_group: multiselect
options:
mapping:
type: keyword
fields: '%index_service.attribute-search-analyzer-attribute-fields%'
country:
type: keyword
filter_group: string
Expand Down
6 changes: 5 additions & 1 deletion src/AppBundle/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ public function searchAction(Request $request, Factory $ecommerceFactory, Produc
"attributes.manufacturer_name.analyzed",
"attributes.manufacturer_name.analyzed_ngram",
"attributes.color",
"attributes.carClass"
"attributes.color.analyzed",
"attributes.color.analyzed_ngram",
"attributes.carClass",
"attributes.carClass.analyzed",
"attributes.carClass.analyzed_ngram"
]
]
],
Expand Down

0 comments on commit 32f81de

Please sign in to comment.