I found a solution to a problem with the TYPO3 solr extension that's been puzzling me for days. This problem has occurred for me on installations of TYPO3 9.5 with the 9.0.2 version of the solr plugin.

Here are the symptoms of the problem:

  • On the results page for search, all results are linked to the homepage
  • In the solr index for every page, the "url" field is indexed as "/" - for every single page.

This is frustrating, but I found that the reason that pages in the search results aren't linked is because the urls aren't linked propery. Every single url in the solr index is "/".

It took me a while to figure this out but how I got solr to start indexing the proper url for each page - and to make the search results link properly - was to add the following typoscript to my template:

plugin.tx_solr.index.queue.pages.fields.url = slug

That's all it took. Now after I deleted the solr index and deleted my index queue, I created a new index queue and I began to index. All of the sites have their "slug" database field as the "url" field in solr. Now all of my links in search results work!