1 Reply Latest reply on Dec 2, 2016 1:46 AM by hchiorean

    [Modeshape 5.2] Query results using residual properties and Lucene indexes

    l.tagliani

      Hi all,

        we're trying to model a repository defining only nodeTypes and not properties or childnode, leaving all to residual definition.

       

      We would like to do so to achieve maximum flexibility in future structure change and customer needs.

       

      All goes well (except performance :-) ) if we doesn't use any kind of indexes.

       

      For this reason we try to use indexes defined on one or more of these residual properties: then things start to go bad.

      In particular, even if the query plan shows that the index will be used, nodes are not found correctly.

       

      We verified this by setting log level to DEBUG: nodes are correctly indexed; also we're sure that the searched node exists, because if we get the node by path, we found it.

       

      Is this a known situation or are we doing something wrong?

       

      BR

       

      Luca Tagliani

        • 1. Re: [Modeshape 5.2] Query results using residual properties and Lucene indexes
          hchiorean

          For this reason we try to use indexes defined on one or more of these residual properties: then things start to go bad.

          Indexes were primarily designed to be used statically together with non-residual properties (i.e. similar to how you would define DB indexes). Using indexes with residual properties is strange to say the least: 4 out of the 5 types of indexes (with the exception of the nodeType indexes) require a concrete property definition for which the indexes should be created and registered. However, residual properties are anything but "concrete".

           

          That being said, even though your use case sounds "exotic" to me, it doesn't mean it should not work. If you can attach some sort of code sample as to what you're trying to do, I could probably tell whether it's supposed to work or not. Also, just in case you're dynamically registering index definitions, because [MODE-2644] Problem in indexing: the indexes are being persisted but they are not recognized and disabled at startup - J… they will not work properly between restarts.