integer-net / solr-magento1

Free Solr Module for Magento 1 for greatly improved search results
GNU Lesser General Public License v3.0
48 stars 12 forks source link

Wrong url rewrite for products using use_html_from_solr #25

Closed emastyle closed 7 years ago

emastyle commented 7 years ago

When indexing from shell and using the option use_html_from_solr = 1, the url rendered for the product is wrong and contains the "integernet-solr.php" in the path. Example of the html generated for grid for an indexed product:

"result_html_grid_nonindex":"\n<a href=\"http://dev-uni.vagrant.dev/unistore/integernet-solr.php/uni-8137-1980.html\" title=\"UNI 8137:1980\" class=\"product-image\"><img src=\"https://dev-uni.vagrant.dev/unistore/media/catalog/product/cache/2/small_image/135x/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/small_image.jpg\" width=\"135\" height=\"135\" alt=\"UNI 8137:1980\" />\n<h2 class=\"product-name\"><a href=\"http://dev-uni.vagrant.dev/unistore/integernet-solr.php/uni-8137-1980.html\" title=\"UNI 8137:1980\">UNI 8137:1980\n\n\n\n\n\n\n \n <div class=\"price-box\">\n

You can see the "integernet-solr.php" in the href...

Some suggestion for debugging?

avstudnitz commented 7 years ago

I can reproduce that if I set "Use Web Server Rewrites" to "No". I strongly recommend that you enable rewrites to get rid of the index.php in the URLs. If that's not possible, you can do a search/replace on the product data using the event integernet_solr_get_product_data. Search for "integernet-solr.php", replace it with "index.php".