Skip to content

Commit 1a52ccc

Browse files
author
Prabhu Ram
committed
MC-21228: Support partial word search in Elasticsearch
- Added partial search for skus in graphql area
1 parent 00401c3 commit 1a52ccc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/code/Magento/CatalogGraphQl/etc/search_request.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
<match field="*"/>
2626
</query>
2727
<query xsi:type="matchQuery" value="$search_term$" name="partial_search">
28+
<match field="*"/>
2829
<match field="name" matchCondition="match_phrase_prefix"/>
30+
<match field="sku" matchCondition="match_phrase_prefix"/>
2931
</query>
3032
<query name="category" xsi:type="filteredQuery">
3133
<filterReference clause="must" ref="category_filter"/>
@@ -65,6 +67,7 @@
6567
<queries>
6668
<query xsi:type="boolQuery" name="graphql_product_search" boost="1">
6769
<queryReference clause="should" ref="search" />
70+
<queryReference clause="should" ref="partial_search" />
6871
<queryReference clause="must" ref="category"/>
6972
<queryReference clause="must" ref="price"/>
7073
<queryReference clause="must" ref="visibility"/>
@@ -73,6 +76,11 @@
7376
<match field="sku"/>
7477
<match field="*"/>
7578
</query>
79+
<query xsi:type="matchQuery" value="$search_term$" name="partial_search">
80+
<match field="*"/>
81+
<match field="name" matchCondition="match_phrase_prefix"/>
82+
<match field="sku" matchCondition="match_phrase_prefix"/>
83+
</query>
7684
<query name="category" xsi:type="filteredQuery">
7785
<filterReference clause="must" ref="category_filter"/>
7886
</query>

0 commit comments

Comments
 (0)