1 Reply Latest reply on Apr 4, 2016 2:41 AM by hchiorean

    How can I configure modeshape 4.2.0 to use local index?

    pcharoen

      I have tried to query 100k nodes in repository. Here is my jcr-sql2.

      SELECT res.[jcr:path] AS sub FROM [fedora:Resource] AS [res] JOIN [fedora:Resource] AS [per] ON res.[jcr:uuid] = per.[webacl:accessTo_ref] WHERE res.[jcr:mixinTypes] = 'fedora:Container' AND res.[model:hasModel] = 'GenericFile' AND per.[model:hasModel] = 'Hydra::AccessControls::Permission' AND per.[webacl:agent] = CAST('http://projecthydra.org/ns/auth/group#public ^^ URI' AS BINARY) LIMIT 500 OFFSET 0

      I have checked in the query.explain.getPlan. It does not seem to use any of indexes that I have created. Thanks,

      Here is my index configuration.

          "indexProviders" : {

              "local" : {

                  "classname" : "org.modeshape.jcr.index.local.LocalIndexProvider",

                  "directory" : "${fcrepo.modeshape.index.directory}",

                  "cacheLRUEnable" : true,

                  "mmapFileEnable" : true,

                  "commitFileSyncDisable" : true,

                  "transactionDisable" : true,

                  "asyncWrite" : true,

                  "cacheSize" : 100

              }

          },

          "indexes" : {

              "jcrMixinTypes" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "jcr:mixinTypes(NAME)"

              },

              "uuid" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "jcr:uuid(STRING)"

              },

              "localName" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "mode:localName(STRING)"

              },

              "accessTo" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "webacl:accessTo_ref(STRING)"

              },

              "hasModel" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "model:hasModel(STRING)"

              },

              "agent" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "webacl:agent(STRING)"

              },

              "lastModified" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "jcr:lastModified(DATE)"

              },

              "type" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "dcterms:type(STRING)"

              },

              "hasCollectionId" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "uatermsid:hasCollectionId(STRING)"

              },

              "isCommunity" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "false",

                  "nodeType" : "fedora:Container",

                  "columns" : "uatermsid:is_community(STRING)"

              }

          }

        • 1. Re: How can I configure modeshape 4.2.0 to use local index?
          hchiorean

          First, please make sure you're using the latest 4.x version - 4.6.0.Final.

          Second, what is the relation in your schema between fedora:Container and fedora:Resource ? All your index definitions are on the former type, while the query is run on the latter type.

          If fedora:Resource is not a subtype of fedora:Container, indexes will not be taken into account. If it is a subtype, can you attach the query plan ?