[TYPO3-Solr] Multilanguage domains

Ingo Renner ingo at typo3.org
Mon Oct 15 11:56:55 CEST 2012


Am 12.10.12 08:51, schrieb Dmitry Dulepov:

Hi Dmitry,

> I see that tx_solr_indexqueue_PageIndexer::getDataUrl() just gets the
> first domain record, appends "L" if necessary and fetches the URL like
> that. It does not work well with conditions based on HTTP_HOST. For
> example:

right, but that really is just the URL the indexer uses to ask the 
actual page indexer (which then runs in FE context) to index the page.

> [globalString = getIndpEnv:HTTP_HOST = www.example.de]

...
If you really need to manipulate the dataURL you might try the 
dataUrlModifier hook with interface 
tx_solr_IndexQueuePageIndexerDataUrlModifier

or use TypoScript:
plugin.tx_solr.index.queue.pages.indexer.frontendDataHelper.(scheme|host|path)

> What I did so far is a small ext that uses a hook in Solr to get the URL
> through the pagepath extension.

The actual URL written to the index is calculated in FE using regular 
typolink in the then existing TSFE. So if I remember that's also what 
your pagepath extension does.
See tx_solr_indexqueue_frontendhelper_PageIndexer->generatePageUrl()

> Where is tx_solr_indexqueue_frontendhelper_PageIndexer? It is something
> FE-related, right?

EXT:solr/classes/indexqueue/frontendhelper/class.tx_solr_indexqueue_frontendhelper_pageindexer.php 
:)

Last but not least, you can also set the overridePageUrl parameter on 
the page indexer request to force a URL. I thought I put a hook or 
something into the extension to do that but can't find such a thing 
currently. So you'd need an xclass for that currently.

That'd be like this in tx_solr_indexqueue_PageIndexer indexPage() or 
buildBasePageIndexerRequest()

$request->setParameter('overridePageUrl', 'http://www.example.com');


HTH,
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2, Admin Google Summer of Code

TYPO3 - Open Source Enterprise Content Management System
http://typo3.org

Apache Solr for TYPO3 -
Open Source Enterprise Search meets Open Source Enterprise CMS
http://www.typo3-solr.com


More information about the TYPO3-project-solr mailing list