1 Reply Latest reply on Jul 27, 2016 3:18 AM by Horia Chiorean

    How to create indexes on properties of referenced nodes?

    Yanick Duchesne Newbie

      Given a schema of the sort:

       

      [my:author] > mix:versionable primaryitem my:username

        - my:username (STRING) mandatory queryops '=, <>, <, <=, >, >=, LIKE'

        - my:email (STRING) mandatory queryops '=, <>, <, <=, >, >=, LIKE' VERSION

       

      [my:text]  > primaryitem my:title

        - my:title (STRING) mandatory queryops '=, <>, <, <=, >, >=, LIKE'

        - my:author (REFERENCE) mandatory

         - my:body (STRING) mandatory queryops 'LIKE'


      How would one go about creating an index for my:text instances based on the author's username and/or email? I can see how this is done for "primitive" properties (here: Query and search - ModeShape 5 - Project Documentation Editor), but I don't see how this is done for properties of reference nodes (that is, for nested properties). I'd like to be able to do something of the sort:


             "textByAuthorUsername" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "true",

                  "nodeType" : "my:text",

                  "columns" : "my:author(REFERENCE):username"

              },

             "textByAuthorEmail" : {

                  "kind" : "value",

                  "provider" : "local",

                  "synchronous" : "true",

                  "nodeType" : "my:text",

                  "columns" : "my:author(REFERENCE):email"

              }

       

      Does ModesShape support indexing nested properties? If not, what would be a recommended strategy, which ideally would not involve abandoning usage of node references?