Magento 2 & ElasticSearch – Fix Category Page Error

catalogsearchmagento2search

I have setup ElasticSearch, and it appears to be working. I am getting some errors thrown when I try and go to certain categories.

The error:

2 exception(s): Exception #0
(Elasticsearch\Common\Exceptions\BadRequest400Exception):
query_parsing_exception: [terms] query does not support [3333841]
within lookup element Exception #1
(Elasticsearch\Common\Exceptions\BadRequest400Exception):
{"error":{"root_cause":[{"type":"query_parsing_exception","reason":"[terms]
query does not support [3333841] within lookup
element","index":"magento2_product_1_v2","line":1,"col":136}],"type":"search_phase_execution_exception","reason":"all
shards
failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_product_1_v2","node":"xG3o7y38SQ2mQEy2Fbgo8g","reason":{"type":"query_parsing_exception","reason":"[terms]
query does not support [3333841] within lookup
element","index":"magento2_product_1_v2","line":1,"col":136}}]},"status":400}

I have output the array that Magento is using to put the json together.

Array ( [from] => 0 [size] => 10000 [fields] => Array ( [0] => _id
[1] => _score ) [query] => Array ( [bool] => Array ( [must] => Array (
[0] => Array ( [term] => Array ( [category_ids] => 73 ) ) ) [should]
=> Array ( [0] => Array ( [terms] => Array ( [sku] => Array ( [3333841] => AFE_49-44038-P [3334470] => AFE_54-74104 [3042494] =>
AIR_200-543 [3088239] => AIR_200-911 [3142337] => AIR_201-785
[1992572] => AVS_21002 [2022347] => AVS_684528 [2775684] =>
B/W_40113-02 [2774641] => B/W_40114-02 [2769029] => B/W_40125-02
[2776408] => B/W_40126-02 [2775436] => B/W_40128-02 [2775302] =>
B/W_40957-14 [2776161] => B/W_40957-24 [2771447] => B/W_40957-34
[2772848] => B/W_40957-54 [2769273] => B/W_40957-64 [2774192] =>
B/W_40957-74 [2770444] => B/W_40959-14 [2775393] => B/W_40959-24
[2775920] => B/W_40959-34 [2776398] => B/W_40959-54 [2769782] =>
B/W_40959-64 [2772952] => B/W_40959-74 [2032877] => CRT_13301
[2037338] => CRT_14301 [2025792] => CRT_31012 [3201465] =>
DZE_DZ15321S [3138031] => ENK_482-290-8410MF [3106013] =>
ENK_482-885-8420MF [2665231] => F4S_CS14-W3150-1 [2662149] =>
F4S_CS14-W3151-1 [2661619] => F4S_J1006 [3025897] => FAB_FTL5107
[3027141] => FAB_FTS21128 [3029125] => FAB_FTS21146 [3027448] =>
FAB_K1059 [3029514] => FAB_K1062 [3035559] => FAB_K1067 [3026473] =>
FAB_K1067M [3025601] => FAB_K1068 [3036135] => FAB_K1068M [3023810] =>
FAB_K1070 [3027271] => FAB_K1071 [3033182] => FAB_K1083 [3032328] =>
FAB_K1083M [3026454] => FAB_K1084 [3033770] => FAB_K1084M [3411551] =>
FLW_817666 [3402489] => FRO_100-21-5012 [3403516] => FRO_110-20-7007
[3403666] => FRO_110-20-7008 [3403146] => FRO_110-20-7009 [3402313] =>
FRO_200-21-4005 [3401420] => FRO_200-21-4010 [2197114] => HUS_15250
[2197975] => HUS_22160 [2201893] => HUS_56881 [2204710] => HUS_57881
[3004666] => HUS_79011 [3253230] => ICI_BOVL521CH [3263384] =>
ICI_FIV20CH [3260851] => ICI_FIV21CH [3254311] => ICI_OVL20CH
[3262713] => ICI_OVL21CH [3258763] => ICI_OVL520CH [3261371] =>
ICI_RTS14CH [3262970] => ICI_RTS16CH [3265408] => ICI_SIX20CH
[3266469] => ICI_SIX21CH [3259111] => ICI_T2274-304M [3257069] =>
ICI_T2276-304M [2627554] => IRO_21-515-14 [2632091] => IRO_41-564
[3344496] => IRO_41-564-B [3344564] => IRO_42-562-B [2628367] =>
IRO_51-560 [2634183] => IRO_51-562 [2629729] => IRO_51-562-B [2635982]
=> IRO_51-564 [2629466] => IRO_51-564-B [3344381] => IRO_52-560 [3344432] => IRO_52-560-B [3344604] => IRO_52-562-B [3344461] =>
IRO_52-568 [3344535] => IRO_53-560 [2766766] => KNN_71-3082 [2616089]
=> MBR_S5080AL [3158359] => MFL_15267 [3156238] => MFL_15268 [3156372] => MFL_15269 [3157284] => MFL_15270 [3156972] => MFL_15359 [3157249] => MFL_15360 [3156755] => MFL_15361 [3163673] => MFL_17146 [3163293] => MFL_17148 [3400034] => N/F_C1489QC-SS [1552559] => POW_16-1363 [1583322] => POW_17-1363 [1849933] => POW_AR8654XPR [1845781] =>
POW_AR8658XPR [1755953] => POW_Z36-1363 [3395755] => RGL_C65U14
[3398942] => RGL_FCC5514 [3397502] => RGL_FCC814 [3398262] =>
RGL_HC-C6514TS [3397351] => RGL_HC-C814 [3246452] => RNH_BSC14HBL1
[3244418] => RNH_FSC14HBL1 [3247377] => RNH_HRC082BLF [3246976] =>
RNH_HRC082BLW [3249795] => RNH_HRC08HBLF [3379893] => RUG_82901.04 ) )
) ) [minimum_should_match] => 1 ) ) [aggregations] => Array (
[price_bucket] => Array ( [extended_stats] => Array ( [field] =>
price_0_1 ) ) [category_bucket] => Array ( [terms] => Array ( [field]
=> category_ids ) ) [manufacturer_bucket] => Array ( [terms] => Array ( [field] => manufacturer ) ) [color_bucket] => Array ( [terms] =>
Array ( [field] => color ) ) ) )

It appears to be the sku portion that is causing the failure. I am not sure where to go from here. I have tried clearing out all the indices from Elastic and basically restarting over with the index. I have checked to make sure the SKU exists, it does, they all do in that list. I guess I am confused on where to go from here to solve this. I don't know what the error is trying to tell me exactly.

Any help is appreciated.

Best Answer

I was able to solve this. When adding a parts finder extension, using EE 2.1, there were some errors in some SQL code and it was causing ElasticSearch to return a 400. This in turn triggered Magento to throw an error. There is no problem here, simply a bad bug in a plugin. Hope this helps someone in the future.

Related Topic