5 Replies Latest reply on Apr 24, 2015 3:26 AM by wesssel

    Hibernate search customization in JBoss EAP 6.3 (Modeshape 3.8.x DV 6.1)

    wesssel

      Hey guys,

       

      There is a possibility to set custom hibernate.search properties in Modeshape, the repository config would look like this:

       

          "query": {

           "indexStorage" : {

            "type" : "filesystem",

            "location" : "/tmp",

          

           },

           "indexing": {

           "hibernate.search.nodeinfo.indexmanager" : "near-real-time",

           },

         

          },

       

      In order to set the variable "hibernate.search.nodeinfo.indexmanager" to near-real-time. This works perfectly and can be seen in the logs:

       

      2015-04-23 19:25:12.660 DEBUG 2213 --- [           main] o.h.s.impl.DefaultIndexManagerFactory    : HSEARCH000166: IndexManager factory resolved alias 'near-real-time' to 'class org.hibernate.search.indexes.impl.NRTIndexManager'.

       

      However, when using the following configuration in EAP's configuration xml:

       

      <indexing hibernate.search.nodeinfo.indexmanager="near-real-time"/>

       

      I am not seeing the indexmanager loading the org.hibernate.search.indexes.impl.NRTIndexManager instance.

       

      Am I doing something wrong? I see hibernate. properties should be picked up the in AddRepository:

       

              for (String key : model.keys()) {

                  if (key.startsWith("hibernate")) {

                      indexing.set(key, model.get(key).asString());

                  }

              }

       

      The near-real-time option should make indexing a lot faster according to their developer Sanne Grinovero.

        • 1. Re: Hibernate search customization in JBoss EAP 6.3 (Modeshape 3.8.x DV 6.1)
          hchiorean

          When you tried the JSON (standalone) config did you use the same Hibernate Search version that ModeShape uses in EAP (atm that is 4.3.0.Final) ? Maybe an older version of Hibernate Search doesn't make use of this property. The EAP subsystem configuration code should be passing all the custom hibernate.search.* configuration properties "down" to the JSON config, so I'm not sure why it wouldn't be passing this particular one as well.

          Also, you should turn on DEBUG logging in EAP for org.modeshape.jboss.*. This should print out the JSON equivalent of the EAP configuration for a repository, so you should be able to track down if there's a bug in the EAP configuration subsystem or not.

          • 2. Re: Hibernate search customization in JBoss EAP 6.3 (Modeshape 3.8.x DV 6.1)
            wesssel

            Yes, I used the same version of Hibernate search as is distributed in the DV 6.1 build.

             

            06:27:06,937 DEBUG [org.modeshape.jboss.service] (MSC service thread 1-2) ModeShape configuration for sample repository: { "name" : "sample" , "jndiName" : "" , "monitoring" : { "enabled" : true } , "workspaces" : { "allowCreation" : true , "default" : "default" } , "storage" : { "cacheName" : "sample" , "cacheConfiguration" : "content" , "binaryStorage" : { "type" : "file" , "directory" : "/opt/jboss/eap/standalone/data/modeshape/sample/sample/binaries" } } , "query" : { "indexing" : { "rebuildOnStartup" : { } , "backend" : { "type" : "lucene" } , "analyzer" : "org.apache.lucene.analysis.standard.StandardAnalyzer" , "threadPool" : "modeshape-indexing-workers" , "batchSize" : -1 , "readerStrategy" : "SHARED" , "mode" : "SYNC" , "asyncThreadPoolSize" : 1 , "asyncMaxQueueSize" : 1 } , "indexStorage" : { "type" : "filesystem" , "location" : "/opt/jboss/eap/standalone/data/modeshape/sample/indexes" } } , "security" : { "jaas" : { "policyName" : "modeshape-security" } , "anonymous" : { "username" : "<anonymous>" , "useOnFailedLogin" : false , "roles" : [ "admin" ] } , "providers" : [ { "classname" : "servlet" } ] } , "garbageCollection" : { "threadPool" : "modeshape-gc" , "initialTime" : "00:00" , "intervalInHours" : 24 } }

            06:27:06,980 DEBUG [org.modeshape.jboss.service] (MSC service thread 1-2) Problems with configuration for sample repository:

            06:27:07,110 INFO  [org.modeshape.jcr.JcrRepository] (MSC service thread 1-2) ModeShape version 3.8.1.Final

             

            So it is not picking up the hibernate.search parameters

            • 3. Re: Hibernate search customization in JBoss EAP 6.3 (Modeshape 3.8.x DV 6.1)
              wesssel

                              if (problems.isEmpty()) {

                                  LOG.debugv("Problems with configuration for {0} repository: {1}", repositoryName, problems);

                              }

               

              Is this supposed to have ! in front of it?

              • 4. Re: Hibernate search customization in JBoss EAP 6.3 (Modeshape 3.8.x DV 6.1)
                hchiorean

                We will hopefully fix https://issues.jboss.org/browse/MODE-2461 for the upcoming Data Virtualization 6.2 release.

                                if (problems.isEmpty()) {

                                    LOG.debugv("Problems with configuration for {0} repository: {1}", repositoryName, problems);

                                }

                 

                Is this supposed to have ! in front of it?

                I don't know what you mean....

                • 5. Re: Hibernate search customization in JBoss EAP 6.3 (Modeshape 3.8.x DV 6.1)
                  wesssel

                  It is somewhat unrelated to this issue, but I've made a pull request:

                   

                  https://github.com/ModeShape/modeshape/pull/1410