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

Using 'jcr:contains' with a hyphen and wildcard in the full-text expression doesn't always work

    Details

      Description

      This started out as a StackOverflow question: http://stackoverflow.com/questions/3572258/

      When issuing a 'jcr:contains' clause (in either XPath or JCR-SQL2), and this clause contains a hyphen, the query will work under some situations but not others. For example, consider content that contains "4-speed" and "5-speed". A query containing this clause will work successfully:

      ... jcr:contains(//*,'"5-speed"') ...

      Even these query that uses a wildcard does work:

      ... jcr:contains(//,'"5-sp"') ...

      or

      ... jcr:contains(//,'"-sp*"') ...

      However, consider content that contains "Sophie-Anne" and "Sophie-Allen". This query does work:

      ... jcr:contains(//*,'"sophia-anne"') ...

      while any queries that include the hyphen and a wildcard do not work:

      ... jcr:contains(//*,'"sophia-anne"') ...

      or

      ... jcr:contains(//,'"sophia-a"') ...

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rhauch Randall Hauch
                Reporter:
                rhauch Randall Hauch
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: