6

We are changing our Tridion infrastructure so multiple sites use the same deployer but two of them use SI4T, one with AWS CloudSearch and the other with Solr. Is it possible to use multiple indexers within the same storage conf file?If it is, do you have an example of where this has been done?

We would also need it to filter on publication per indexer, i think you mentioned on your site that the indexer can do this. Is that right?

issue posted github

7

In theory this should be possible. Note that you can only have 1 Indexer per storage configuration, so if you want to do this, you need something like:

    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration Version="8.5"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="file:///cd_storage_conf.xsd">
        <Global>
            <!-- SI4T:
                    Example SI4T / Solr config. Merge with existing config
            -->
            <Storages>

               <StorageBindings>
                    <!-- SI4T: 
                            configure custom DAO Bundles
                    -->
                   <Bundle src="SearchDAOBundle.xml"/>
                </StorageBindings>
                <!-- SI4T: 
                        Example configuration in case JPA is used to publish pages. This is for example the case in DD4T setups.
                        The standard Class com.tridion.storage.JAPDAOFactory is overridden.
                        It is possible to mix and match JPA and FS Search DAO factories should there be need.
                -->
                <Storage 
                    Type="persistence" Id="defaultdb" dialect="MSSQL" 
                    Class="com.tridion.storage.si4t.JPASearchDAOFactory">
                    <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
                    <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
                        <Property Name="serverName" Value="[SERVERNAME]" />
                        <Property Name="portNumber" Value="[DBPORT]" />
                        <Property Name="databaseName" Value="[DBNAME]" />
                        <Property Name="user" Value="[DBBROKERUSERNAME]" />
                        <Property Name="password" Value="[DBBROKERPASSWORD]" />
                    </DataSource>
                    <!--    SI4T: configure the indexer class, 
                            as well as which binaries to index, the default URL to post documents to as well as
                            pointing the indexer to specific cores for specific Publications.
                    -->
                    <Indexer 
                        Class="org.si4t.solr.SolrIndexer" 
                        DefaultCoreUrl="http://localhost:8080/solr/staging" 
                        Mode="http" 
                        DocExtensions="pdf,docx,doc,xls,xlsx,pptx,ppt">
                        <Urls>
                            <!-- SI4T: 
                                    The Value attribute is the complete URL to a Solr Core
                                    The Id attribute denotes a unique Tridion Publication Id
                            -->
                            <Url Value="http://localhost:8080/solr/staging_pub5" Id="5" />
                            <Url Value="http://localhost:8080/solr/staging" Id="8" />
                            <Url Value="http://localhost:8080/solr/staging" Id="12" />
                        </Urls>
                    </Indexer>
                </Storage>


                <Storage
                        Type="persistence" Id="otherdatastoreid" dialect="MSSQL"
                        Class="com.tridion.storage.si4t.JPASearchDAOFactory">
                    <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
                    <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
                        <Property Name="serverName" Value="[SERVERNAME]" />
                        <Property Name="portNumber" Value="[DBPORT]" />
                        <Property Name="databaseName" Value="[DBNAME]" />
                        <Property Name="user" Value="[DBBROKERUSERNAME]" />
                        <Property Name="password" Value="[DBBROKERPASSWORD]" />
                    </DataSource>
                    <!--    SI4T: configure the indexer class,
                            as well as which binaries to index, the default URL to post documents to as well as
                            pointing the indexer to specific cores for specific Publications.
                    -->
                    <Indexer Class="org.si4t.cloudsearch.CloudSearchIndexer"
                             authentication="implicit"
                             access_key_id=""
                             secret_access_key=""
                             documentEndpoint="-Your AWS CloudSearch Document endpoint URL-"
                             DocExtensions="pdf,docx,doc,xls,xlsx,pptx,ppt"
                             indexBatchSize="20" />
                </Storage>
            </Storages>
        </Global>
        <ItemTypes defaultStorageId="defaultdb" cached="false">
            <Publication id="22" defaultStorageId="defaultId" cached="false">
                <Item />

            </Publication>

            <Publication id="55" defaultStorageId="otherdatastoreid" cached="false">
                <Item />

            </Publication>

        </ItemTypes>

        <!-- Specifies the location of the license file. -->
        <License Location=""/>
    </Configuration>

So, you basically map different publications to different storageIds which have different indexers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.