Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2068

SimpleSearchTag does not use jcr:contains properly

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.6, 3.5.9
    • 3.5.4
    • taglibs
    • None

      The current implementation from the SimpleSearchTag generates queries which seem unnecessarily complex and underuse the power of the jcr:contains function. As a (rather bad) side effect, they also prevent from doing full phrase searches, as words which are normally not indexed (like "the") are not ignored.

      An example: if I search for "i love the fresh strawberries from my garden", the SimpleSearchTag currently generates a query like
      //[@jcr:primaryType='mgnl:content']//[jcr:contains(., 'i') and jcr:contains(., 'love')
      and jcr:contains(., 'the') and jcr:contains(., 'fresh') and jcr:contains(., 'strawberries')
      and jcr:contains(., 'from') and jcr:contains(., 'my') and jcr:contains(., 'garden')]
      which returns no results.

      If we'd use a query like
      //[@jcr:primaryType='mgnl:content']//[jcr:contains(., 'i love the fresh strawberries from my garden')]
      ... then we get the expected results.

      See "6.6.5.2 jcr:contains Function" from the JCR Spec (pages 110-111) for details.

        Acceptance criteria

              gjoseph Magnolia International
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD