4 Replies Latest reply on Mar 3, 2016 5:57 AM by folch

    Losing index results after updating a boolean attribute

    folch

      Hi,

       

      I'm trying the following in Modeshape 4.5.0.Final and 4.6.0.Final.

      I've defined an index like this:

       

      "indexProviders" : {

              "local" : {

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

                  "directory" : "index",

                  "cacheLRUEnable" : true,

                  "mmapFileEnable" : true,

                  "commitFileSyncDisable" : true

              }

          },

          "indexes" : {

              "editorsByIsActive" : {

                  "kind" : "value",

                  "provider" : "local",

                  "nodeType" : "hes:editor",

                  "columns" : "isActive( BOOLEAN )"

              }

        }

       

      And I run the following steps:

       

      1. Create node1 with mixin: hes:editor and with an attribute isActive = true
      2. Create node2 with mixin: hes:editor and with an attribute isActive = true
      3. Run the following queries
        1. select * from [hes:editor] where isActive=true - return 2 nodes
        2. select * from [hes:editor] - return: 2 nodes
      4. Update node2 setting isActive=false
      5. Run again the same queries
        1. select * from [hes:editor] where isActive=true - return 0 nodes
        2. select * from [hes:editor] - return: 2 nodes
      6. Reindex (calling reindex API)
      7. Run again the same queries
        1. select * from [hes:editor] where isActive=true - return 1 node
        2. select * from [hes:editor] - return: 2 nodes

       

      This is working in Modeshape 4.4.0.Final

      But it's failing in Modeshape 4.5.0.Final and 4.6.0.Final

       

      Thanks in advance