Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-1081

FullTextSearch in asset chooser uses wrong wildcard

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 3.0.18
    • None

      Steps to reproduce

      1.  Open a page to edit and add an image component
      2.  In the asset chooser, click on the magnifying glass to open full text search
      3. type "div"

      Expected results

      Assets containing "div" in any of their properties are shown (there are two of them in demo)

      Actual results

      No results are returned

      Workaround

      Adding more characters seems to work better. In the example, typing the complete word "diving" would return correctly the two assets

      Development notes

      The generated query can be seen by setting info.magnolia.dam.jcr.JcrAssetProvider to DEBUG:

      SELECT * FROM [nt:base] AS t WHERE t.[jcr:primaryType] = 'mgnl:asset' AND (LOWER(LOCALNAME(t)) LIKE '%div%' OR LOWER(t.caption) LIKE '%div%' OR CONTAINS(t.*, '%div%'))

      The usage of wildcar % is meant for LIKE and seems it's not meant for CONTAINS. This can be confirmed by testing same query with both wildcards in JCR tools.

      Measure and record the times before the change and after the change in this ticket using the big data environment.

        Acceptance criteria

              Unassigned Unassigned
              jayala Jonathan Ayala
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD