Scripts may be no longer than 16384 characters

{"0":"{"error":{"root_cause":[{"type":"script_exception","reason":"compile error","script_stack":,"script":"def s = ['23353':2383,'12157':2382,'12163':2381,'12166':2380,'20304':2379,'23535':2378,'12161'......,]; def id = Long.toString(doc['id'].value); return s[id];","lang":"painless"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"default_product_idx1","node":"tO4GMfe-QJ6joi_GlhvV1A","reason":{"type":"query_shard_exception","reason":"script_score: the script could not be loaded","index_uuid":"k9ipkQZQRweLruAdHTIrSg","index":"default_product_idx1","caused_by":{"type":"script_exception","reason":"compile error","script_stack":,"script":"def s = ['23353':2383,'12157':2382,'12163':2381,'12166':2380,'20304':2379,'23535':2378,'12161':2377,'12165'....]; def id = Long.toString(doc['id'].value); return s[id];","lang":"painless","caused_by":{"type":"illegal_argument_exception","reason":"Scripts may be no longer than 16384 characters. The passed in script is 29931 characters. Consider using a plugin if a script longer than this length is a requirement."}}}}],"caused_by":{"type":"script_exception","reason":"compile error","script_stack":,"script":"def s = ['23353':2383,'12157':2382,'12163':2381,'12166':2380,'20304':2379,'23535':2378,'12161':2377,...]; def id = Long.toString(doc['id'].value); return s[id];","lang":"painless","caused_by":{"type":"illegal_argument_exception","reason":"Scripts may be no longer than 16384 characters. The passed in script is 29931 characters. Consider using a plugin if a script longer than this length is a requirement."}}},"status":400}","1":"#0 /home/bfcshop/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(279): Elasticsearch\Connections\Connection->process4xxError(Array, Array, Array)