Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2037

Extended Like Operation

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • 3.6.0.Final
    • 3.5.0.Final
    • JCR, Query
    • None

    Description

      Add extended like operation when pattern stored in document property.

      The standard JCR-SQL2 LIKE operator takes as input a fixed pattern and then attempts to find nodes whose value for the given property matches the pattern. However, sometimes the property values might actually store the patterns, and you want to find all property patterns that match a given fixed string parameter. The RELIKE (or "reverse like") makes this possible.

      To make this function more clear from the standard LIKE, the operands are reversed so that the pattern is the second parameter of both RELIKE and LIKE.

      For example, if the property of node "my:namePattern" on a node of type "my:country" contains a matching pattern of country name (e.g., "%Monaco%"), then we can find all "my:country" nodes that have a name pattern that matches "Principality of Monaco":

      SELECT * 
      FROM [my:country] AS country
      WHERE RELIKE("Principality of Monaco", country.[my:namePattern]);
      

      Attachments

        Activity

          People

            ybrig Yury Brigadirenko (Inactive)
            ybrig Yury Brigadirenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: