0 Replies Latest reply on Sep 24, 2014 7:12 AM by Jithendra reddy

    Infinispan Search - Lucene indexing not getting created with two similar namedcaches

    Jithendra reddy Newbie

      Hi Team,

       

      I have had this trouble for quite a while and i am getting no where on this. So putting it here to get some expert help.

       

      We have configured infinispan searching into our application. All of the configuration is done through xml. No programmatic configuration. xml is attached.

       

      A number of namedCaches were created as part of the configuration, with each namedCache having the hibernate search properties also configured. The namedCache "qci-cache" holds a map of <String, InventoryItem pojo>. Some of the fields of the InventoryItem pojo are being indexed.

       

      Another namedCache "qci-cache-temp" also holds the similar map. Only difference being that qci-cache is permanent and qci-cache-temp has an expiration of an hour.

       

      Both caches are DIST and are configured to use custom configured caches for their indexing purposes, as we are using infinispan directory for holding the indexes. jgroups being used as the backend, to have only one node doing the index updates.

       

      Printing the xml snippets for the configuration that i spoke of, here for quick ref.

       

      QCI-CACHE:

      <namedCache name="qci-cache">

            <locking lockAcquisitionTimeout="300000" useLockStriping="false" concurrencyLevel="500" />

            <clustering mode="DIST">

               <async/>

               <stateTransfer  timeout="480000" fetchInMemoryState="true" />

            </clustering>

            <indexing enabled="true">

              <properties>

                  <property name="hibernate.search.default.directory_provider" value="infinispan"/>

                  <property name="hibernate.search.default.cachemanager_resourcename" value="${cms.root}/Vipr/infinispan/infinispan-lucene-config.xml" />

                  <property name="hibernate.search.services.jgroups.configurationFile" value="file:${cms.root}/Vipr/infinispan/jgroups-lucene.xml" />

                  <property name="hibernate.search.default.locking_cachename" value="ViprLuceneIndexesLocking"/>

                  <property name="hibernate.search.default.data_cachename" value="ViprLuceneIndexesData"/>

                  <property name="hibernate.search.default.metadata_cachename" value="ViprLuceneIndexesMetadata"/>

                  <property name="hibernate.search.lucene_version" value="LUCENE_36"/>

                  <property name="hibernate.search.default.indexmanager" value="directory-based" />

                  <!-- The following property is put in all the searchmapping making an object indexable -->

                  <property name="hibernate.search.model_mapping" value="com.ctl.vnom.cache.searchmapping.ViprQciSearchMappingFactory"/>

                  <property name="hibernate.search.default.worker.execution" value="async"/>

                  <property name="hibernate.search.default.worker.thread_pool" value="5"/>

                  <property name="hibernate.search.default.worker.buffer_queue_max" value="1000"/>

                  <property name="hibernate.search.default.worker.backend" value="jgroups"/>

                  <property name="hibernate.search.analyzer"  value="com.ctl.vnom.lib.cache.analyzer.StandardAnalyzerWithNoStopWords" />

              </properties>

            </indexing>

            <jmxStatistics enabled="true"/>

         </namedCache>

       

         QCI-CACHE-TEMP:

      <namedCache name="qci-cache-temp">

            <locking lockAcquisitionTimeout="300000" useLockStriping="false" concurrencyLevel="500"/>

            <expiration lifespan="1200000" maxIdle="1200000"/>

         <clustering mode="DIST">

               <async/>

               <stateTransfer  timeout="480000" fetchInMemoryState="true" />

            </clustering>

            <indexing enabled="true">

              <properties>

                  <property name="hibernate.search.default.directory_provider" value="infinispan"/>

                  <property name="hibernate.search.default.cachemanager_resourcename" value="${cms.root}/Vipr/infinispan/infinispan-lucene-config.xml" />

                  <property name="hibernate.search.services.jgroups.configurationFile" value="file:${cms.root}/Vipr/infinispan/jgroups-lucene.xml" />

                  <property name="hibernate.search.default.locking_cachename" value="ViprLuceneTempIndexesLocking"/>

                  <property name="hibernate.search.default.data_cachename" value="ViprLuceneTempIndexesData"/>

                  <property name="hibernate.search.default.metadata_cachename" value="ViprLuceneTempIndexesMetadata"/>

                  <property name="hibernate.search.lucene_version" value="LUCENE_36"/>

                  <property name="hibernate.search.default.indexmanager" value="directory-based" />

                  <!-- The following property is put in all the searchmapping making an object indexable -->

                  <property name="hibernate.search.model_mapping" value="com.ctl.vnom.cache.searchmapping.ViprQciTempSearchMappingFactory"/>

                  <property name="hibernate.search.default.worker.execution" value="async"/>

                  <property name="hibernate.search.default.worker.thread_pool" value="5"/>

                  <property name="hibernate.search.default.worker.buffer_queue_max" value="1000"/>

                  <property name="hibernate.search.default.worker.backend" value="jgroups"/>

                  <property name="hibernate.search.analyzer"  value="com.ctl.vnom.lib.cache.analyzer.StandardAnalyzerWithNoStopWords" />

              </properties>

            </indexing>

            <jmxStatistics enabled="true"/>

         </namedCache>

       

      CUSTOM CONFIGURED INDEX CACHES FOR USE BY HIBERNATE SEARCH:

      <!-- *************************************** -->

          <!--  Cache to store Lucene's file metadata  -->

          <!-- *************************************** -->

          <namedCache name="ViprLuceneQciIndexesMetadata">

              <clustering mode="REPL">

                  <stateTransfer fetchInMemoryState="true" />

                  <sync replTimeout="25000" />

              </clustering>

        <transaction transactionMode="TRANSACTIONAL" />

        <invocationBatching enabled="true"/>

          </namedCache>

       

       

          <!-- **************************** -->

          <!--  Cache to store Lucene data  -->

          <!-- **************************** -->

          <namedCache name="ViprLuceneQciIndexesData">

              <clustering mode="DIST">

                  <stateTransfer fetchInMemoryState="true" />

                  <sync replTimeout="25000" />

              </clustering>

        <transaction transactionMode="TRANSACTIONAL" />

        <invocationBatching enabled="true"/>

          </namedCache>

       

       

          <!-- ***************************** -->

          <!--  Cache to store Lucene locks  -->

          <!-- ***************************** -->

          <namedCache

              name="ViprLuceneQciIndexesLocking">

              <clustering mode="DIST">

                  <stateTransfer fetchInMemoryState="true" />

                  <sync replTimeout="25000" />

              </clustering>

        <transaction transactionMode="TRANSACTIONAL" />

        <invocationBatching enabled="true"/>

          </namedCache>

       

       

       

       

        <!-- *************************************** -->

          <!--  Cache to store Lucene's file metadata  -->

          <!-- *************************************** -->

          <namedCache name="ViprLuceneQciTempIndexesMetadata">

              <clustering mode="REPL">

                  <stateTransfer fetchInMemoryState="true" />

                  <sync replTimeout="25000" />

              </clustering>

        <transaction transactionMode="TRANSACTIONAL" />

        <invocationBatching enabled="true"/>

          </namedCache>

       

       

          <!-- **************************** -->

          <!--  Cache to store Lucene data  -->

          <!-- **************************** -->

          <namedCache name="ViprLuceneQciTempIndexesData">

              <clustering mode="DIST">

                  <stateTransfer fetchInMemoryState="true" />

                  <sync replTimeout="25000" />

              </clustering>

        <transaction transactionMode="TRANSACTIONAL" />

        <invocationBatching enabled="true"/>

          </namedCache>

       

       

          <!-- ***************************** -->

          <!--  Cache to store Lucene locks  -->

          <!-- ***************************** -->

          <namedCache

              name="ViprLuceneQciTempIndexesLocking">

              <clustering mode="DIST">

                  <stateTransfer fetchInMemoryState="true" />

                  <sync replTimeout="25000" />

              </clustering>

        <transaction transactionMode="TRANSACTIONAL" />

        <invocationBatching enabled="true"/>

          </namedCache>

       

      My assumption with this configuration is that, qci-cache and qci-cache-temp should use their own index directories in infinispan and they should create different index files of the InventoryItems being put into each of those caches seperately.

       

      But the issue i am facing here is that, with the above configuration, the inventoryItems put in either of these caches are not indexed at all, which is causing my search on these inventoryItems to fail. Can any body let me know, what is it that i am doing wrong here?