Fatal error: Uncaught Solarium\Exception\HttpException: Solr HTTP error: Bad Request (400) in /var/www/modx/assets/snippets/solrsearch/vendor/solarium/solarium/library/Solarium/Core/Query/Result/Result.php on line 103 Solarium\Exception\HttpException: Solr HTTP error: Bad Request (400) in /var/www/modx/assets/snippets/solrsearch/vendor/solarium/solarium/library/Solarium/Core/Query/Result/Result.php on line 103 Call Stack: 0.0000 399096 1. {main}() /var/www/modx/index.php:0 0.0006 520544 2. DocumentParser->executeParser() /var/www/modx/index.php:184 0.0018 773888 3. DocumentParser->prepareResponse() /var/www/modx/manager/includes/document.parser.class.inc.php:2862 0.0021 783696 4. DocumentParser->parseDocumentSource() /var/www/modx/manager/includes/document.parser.class.inc.php:2971 0.0078 939808 5. DocumentParser->evalSnippets() /var/www/modx/manager/includes/document.parser.class.inc.php:2717 0.1670 1606504 6. DocumentParser->_get_snip_result() /var/www/modx/manager/includes/document.parser.class.inc.php:2027 0.1670 1607312 7. DocumentParser->evalSnippet() /var/www/modx/manager/includes/document.parser.class.inc.php:2115 0.1673 1703512 8. eval('// set the base path $path = $modx->config['base_path'] . 'assets/snippets/solrsearch'; $sePath = $modx->config['base_path'] . 'assets/snippets/searchengine'; $lPath = $modx->config['base_path'] . 'assets/snippets/maskinbladet/leasing'; if (!class_exists('SEconfig')) require $sePath . '/config.class.php'; if (!class_exists('imgSEO')) require $sePath . '/img_seo.class.php'; if (!class_exists('Leasing')) require $lPath . '/leasing.class.php'; require_once $path . '/conf/init.php'; require_once $path . '/DictionaryManager.php'; require_once $path . '/UrlManager.php'; require_once $path . '/SearchClient.php'; require_once $path . '/CategoryTree.php'; if (!isset($modx->config['solr_lang'])) $modx->config['solr_lang'] = solrLang::getObject(); $openx_banners = array( 'mega_banner' => array('zoneid' => '221', 'width' => '930', 'height' => '90'), 'mega_banner_mobil' => array('zoneid' => '228', 'width' => '600', 'height' => '225'), ); // Advertisement array $advertisements = array(); foreach ($openx_banners as $openx_name => $openx_info) { $openx_status = @file_get_contents('https://adserver.fbg.dk/www/delivery/check.php?zoneid='.$openx_info['zoneid']); $advertisements[$openx_name] = (is_numeric($openx_status) && $openx_status == 1 ? $modx->runSnippet('2019_openx_zone_single_res', $openx_info) : ''); } $advertisements['sky_banner'] = $modx->getChunk('2019_skybanner'); //BrugtPro feature array $brugtpro = array( 'solr_top' => $modx->getChunk('2020_searchengine_solr_brugtpro_top'), ); $loader = new Twig_Loader_Filesystem($path . '/templates'); $twig = new Twig_Environment($loader); $twig->addExtension(new Twig_Extensions_Extension_Text()); $defaultPageSize = 16; $urlManager = new UrlManager(); $searchClient = new SearchClient($defaultPageSize); $dictionaryManager = new DictionaryManager(); $requestArray = $urlManager->getSearchConfig(); $searchResults = $searchClient->getSearchResults($requestArray); // Return error page when fatal fault in SOLR if ($searchResults === false) return $twig->render( '2019.error-page.html', array( 'advertisements' => $advertisements, 'siteUrl' => $modx->config['site_url'], 'language' => $modx->config['solr_lang'], ) ); $currentPage = $urlManager->getFilterValue('p') ? $urlManager->getFilterValue('p') : 1; $categoryTree = new CategoryTree($urlManager->getCategoryNodeId()); $pageSize = isset($requestArray['rows']) && is_numeric($requestArray['rows']) && $requestArray['rows'] > 0 ? $requestArray['rows'] : $defaultPageSize; $categoryTree->setFacets($searchResults['facets']['treenode_id']); //sort facets by titles foreach (array('country_id', 'location_id', 'brand_id') as $facetKey) { $facetTitles = array(); foreach ($searchResults['facets'][$facetKey] as $id => $count) { $title = $dictionaryManager->getPhrase($facetKey, $id); if ($title != '') $facetTitles[$id] = $title; } asort($facetTitles); $facetArray = array(); foreach ($facetTitles as $id => $title) { $facetArray[$id] = $searchResults['facets'][$facetKey][$id]; } $searchResults['facets'][$facetKey] = $facetArray; } // ad age options $adAgeOptions = array( "*" => $modx->config['solr_lang']->getString('238'), "NOW-1DAY" => $modx->config['solr_lang']->getString('239'), "NOW-2DAYS" => $modx->config['solr_lang']->getString('240'), "NOW-3DAYS" => $modx->config['solr_lang']->getString('241'), "NOW-7DAYS" => $modx->config['solr_lang']->getString('242'), "NOW-14DAYS" => $modx->config['solr_lang']->getString('243'), "NOW-21DAYS" => $modx->config['solr_lang']->getString('244'), "NOW-28DAYS" => $modx->config['solr_lang']->getString('245'), "NOW-3MONTHS" => $modx->config['solr_lang']->getString('246'), "NOW-6MONTHS" => $modx->config['solr_lang']->getString('247'), "NOW-1YEAR" => $modx->config['solr_lang']->getString('248'), ); // Set page title $currentPath = $categoryTree->getPath(); $currentCategory = strtolower(array_pop($currentPath)); $categoryTitle = false; if (count($currentPath) > 0) { switch ($currentCategory) { case '1e8ae347-0cba-4690-aa94-e2684c779158': $categoryTitle = 'Nye og brugte landbrugsmaskiner og landbrugsudstyr'; break; case '20a3b1dd-c7ec-4164-b8ce-d91824a0057a': $categoryTitle = 'Nye og brugte have- og parkmaskiner'; break; case 'f268d600-625f-4650-ab91-b3cfef4c9f0d': $categoryTitle = 'Nye og brugte entreprenørmaskiner og entreprenørudstyr'; break; case '63d5843d-e6bc-4663-8d33-19cc6f1039e4': $categoryTitle = 'Nye og brugte maskiner og udstyr inden for transport'; break; case '2da0e3c6-3447-4f77-b36e-c5e957cb6141': $categoryTitle = 'Nye og brugte maskiner inden for skovbrug'; break; case '2435ca07-f635-4263-a14f-b1d24960f7d7': $categoryTitle = 'Nye og brugte maskiner og udstyr inden for industri'; break; default: $categoryTitle = 'Brugte ' . strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)) . ' til salg | Nye ' . strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)) . ' til salg | Køb og salg af ' . strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)) .''; break; } if ($urlManager->onAuction()) $categoryTitle .= ' på auktion'; } elseif ($urlManager->isLatest() || $urlManager->isFeatured() || $urlManager->isStolen() || $urlManager->onAuction()) { if ($urlManager->isLatest()) { $categoryTitle = 'Senest oprettede brugte maskiner og udstyr'; } elseif ($urlManager->isFeatured()) { $categoryTitle = 'Fremhævede brugte maskiner og udstyr'; } elseif ($urlManager->isStolen()) { $categoryTitle = 'Stjålne brugte maskiner og udstyr'; } elseif ($urlManager->onAuction()) { $categoryTitle = 'Brugte maskiner og udstyr på auktion'; } elseif ($urlManager->isScrapyard()) { $categoryTitle = 'Ophuggede maskiner og udstyr'; } } $_curr_cat = strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)); $metaDescription = 'Køb og salg af nye og brugte ' . strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)) . '. Stort udvalg af nye og brugte ' . strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)) . '. Find nye og brugte ' . strtolower($dictionaryManager->getPhrase('tree_node_id', $currentCategory)) . ' på Maskinbladet'; $metaKeywords = $_curr_cat . ', nye ' . $_curr_cat . ', brugte ' . $_curr_cat . ', køb ' . $_curr_cat . ', sælg ' . $_curr_cat . ', find ' . $_curr_cat; //$modx->setPlaceholder('title_tag', ($categoryTitle ? $categoryTitle.' | ' : '')); $modx->setPlaceholder('title_tag', ($categoryTitle ? $categoryTitle.' | Søgeresultat ' : 'Søgeresultat ')); //ændret //$modx->setPlaceholder('title_tag', ($categoryTitle ? $categoryTitle.' | ' : '')); $modx->setPlaceholder('meta_description', $metaDescription); $modx->setPlaceholder('meta_keywords', $metaKeywords); // Landing page for known brands if (isset($_GET['brand_id']) && trim($_GET['brand_id']) != '' && isset($_GET['info']) && trim($_GET['info']) == 1) { $brand_name = $dictionaryManager->getPhrase('brand_id', $_GET['brand_id']); $brand_clean = str_replace(array('-', '_', '/', ' '), '', $brand_name); $chunkPrepared = $modx->getChunk( strtolower($brand_clean) ); $chunkDefault = $modx->parseChunk('default_brand', array('brand' => ucfirst($brand_name)), '[+', '+]'); $modx->setPlaceholder('title_tag', 'Info om ' . $brand_name . ' | Brugte ' . $brand_name . ' maskiner til salg '); $modx->setPlaceholder('meta_keywords', $brand_name.', traktorer, brugte ' . $brand_name . ' maskiner, nye ' . $brand_name . ' maskiner, Maskinbladet'); $modx->setPlaceholder('meta_description', 'Information om ' . $brand_name . ' | Find nye eller brugte '.$brand_name.' maskiner til salg her på Maskinbladet.dk'); $modx->setPlaceholder('Brandname', $brand_name); $modx->setPlaceholder('preparedBrand', $chunkPrepared); $modx->setPlaceholder('defaultBrand', $chunkDefault); } function changeRequestURI(array $param) { $pu = parse_url($_SERVER["REQUEST_URI"]); if (isset($pu['query'])) { parse_str($pu['query'], $ps); } else { $ps = array(); } return $pu['path'] . '?' . http_build_query(array_merge($ps, $param)); } if ($currentPage > 1) { $seo_prev_url = $modx->config['site_url'] . ltrim(changeRequestURI(array('p' => ($currentPage - 1))), '/'); $modx->setPlaceholder('seo_pager_prev', ''); } if ($currentPage < ceil($searchResults['numFound'] / $pageSize)) { $seo_next_url = $modx->config['site_url'] . ltrim(changeRequestURI(array('p' => ($currentPage + 1))), '/'); $modx->setPlaceholder('seo_pager_next', ''); } $adStatus = 'online'; if (isset($_GET['adStatus']) && trim($_GET['adStatus']) != '') { $adStatus = trim($_GET['adStatus']); } return $twig->render( '2019.search-page.html', array( 'searchResults' => $searchResults, 'currentPage' => $currentPage, 'pageSize' => $pageSize, 'urlManager' => $urlManager, 'searchClient' => $searchClient, 'categoryTree' => $categoryTree, 'dictionaryManager' => $dictionaryManager, 'adAgeOptions' => $adAgeOptions, 'adStatus' => $adStatus, 'advertisements' => $advertisements, 'brugtpro' => $brugtpro, 'siteUrl' => $modx->config['site_url'], 'imgSEO' => new imgSEO(), 'seconfig' => new SEconfig(), 'language' => $modx->config['solr_lang'], 'leasing' => new Leasing(), 'leasing_stats_url' => $modx->makeURL(114), ) );') /var/www/modx/manager/includes/document.parser.class.inc.php:1964 0.2073 8173928 9. SearchClient->getSearchResults() /var/www/modx/manager/includes/document.parser.class.inc.php(1964) : eval()'d code:45 0.2214 8177432 10. SearchClient->getTopSearchAds() /var/www/modx/assets/snippets/solrsearch/SearchClient.php:209 0.2219 8270568 11. Solarium\Client->select() /var/www/modx/assets/snippets/solrsearch/SearchClient.php:591 0.2219 8270568 12. Solarium\Client->execute() /var/www/modx/assets/snippets/solrsearch/vendor/solarium/solarium/library/Solarium/Core/Client/Client.php:880 0.2234 8285168 13. Solarium\Client->createResult() /var/www/modx/assets/snippets/solrsearch/vendor/solarium/solarium/library/Solarium/Core/Client/Client.php:768 0.2236 8290512 14. Solarium\QueryType\Select\Result\Result->__construct() /var/www/modx/assets/snippets/solrsearch/vendor/solarium/solarium/library/Solarium/Core/Client/Client.php:737