Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-11401

Unpredictable results with Advanced Search in Explorer

    Details

    • Bug Priority:
      Category 4
    • ACT Numbers:

      00152306

      Description

      1. Technical Description of the issue : Advanced searches in Alfresco Explorer generate an incorrect Lucene query.

      2. Customers Description of the problem : "I can't explain why the result from the advanced search is different from the result of a lucene query in the node browser. "

      3. Supporting evidence : When an advanced search is created that includes text keywords and other search fields (like description, title, author, etc.), the generated Lucene query looks like the following:

      This is a simplified version for clarity. I removed prefixes and escaping

      ( description:"description1" title:"title0001" author:"author0001" AND ((TYPE:"content" AND (name:"text0001" TEXT:"text0001")) ( TYPE:"folder" AND ((name:"text0001" TEXT:"text0001" )))))

      As you can see, that query is equivalent to:

      ( description:"description1" OR title:"title0001" OR author:"author0001" AND ((TYPE:"content" AND (name:"text0001" TEXT:"text0001")) ( TYPE:"folder" AND ((name:"text0001" TEXT:"text0001" )))))

      In that case, "author" AND the search text is searched, while the description and the title are optional.

      However, if no author is being searched, the search would look like:

      ( description:"description1" OR title:"title0001" AND ((TYPE:"content" AND (name:"text0001" TEXT:"text0001")) ( TYPE:"folder" AND ((name:"text0001" TEXT:"text0001" )))))

      In this case, the title AND the search text is searched, while the description is optional.

      This is frustrating to customers, because the behavior of the search changes when some fields are being included in the advanced search.

      Steps to reproduce

      0. Set logging for org.alfresco.solr.query.AbstractQParser to FINE
      1. Log into Alfresco Explorer
      2. Go to Advanced Search
      3. Enter the following search:
      Keyword: text001
      Description: description001
      Title: title001
      Author: author001

      4. Repeat search, but don't include the author. That is:
      Keyword: text001
      Description: description001
      Title: title001

      Expected Behaviour
      Parenthesis should be added to ensure proper evaluation of generated expression.
      1. On step 3, a query like the following should be generated (added blank like for clarity. Note the additional parenthesis in front of the description, and after the author):
      (
      ( @

      {http\\://www.alfresco.org/model/content/1.0\\}

      description:\"description0001\" @

      {http\\://www.alfresco.org/model/content/1.0\\}

      title:\"title0001\" @

      {http\\://www.alfresco.org/model/content/1.0\\}

      author:\"author0001\" )
      AND (( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      content\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" ))) ( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      folder\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" )))))

      2. On step 4, a query like the following should be generated (added blank like for clarity. Note the additional parenthesis in front of the description, and after the title):
      (
      ( @

      {http\\://www.alfresco.org/model/content/1.0\\}

      description:\"description0001\" @

      {http\\://www.alfresco.org/model/content/1.0\\}

      title:\"title0001\" )
      AND (( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      content\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" ))) ( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      folder\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" )))))

      Observed Behaviour
      1. A query like the following is observed after step 3 ( spaces are added for clarity ):
      May 2, 2014 5:37:14 PM org.alfresco.solr.query.AbstractQParser getSearchParameters
      FINE: {"textAttributes":[],"authorities":["GROUP_ALFRESCO_ADMINISTRATORS","GROUP_EMAIL_CONTRIBUTORS","GROUP_EVERYONE","GROUP_site_swsdp","GROUP_site_swsdp_SiteManager","ROLE_ADMINISTRATOR","ROLE_AUTHENTICATED","admin"],"templates":[],"allAttributes":[],"tenants":[""],"query":"(
      @

      {http\\://www.alfresco.org/model/content/1.0\\}

      description:\"description0001\" @

      {http\\://www.alfresco.org/model/content/1.0\\}

      title:\"title0001\" @

      {http\\://www.alfresco.org/model/content/1.0\\}

      author:\"author0001\"
      AND (( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      content\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" ))) ( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      folder\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" ))))) AND NOT ASPECT:\"sys:hidden\" ","locales":["en_US"],"defaultNamespace":"http://www.alfresco.org/model/content/1.0","defaultFTSOperator":"OR","defaultFTSFieldOperator":"OR"}

      2. A query like the following is observed after step 3 ( spaces are added for clarity ):
      May 2, 2014 5:38:24 PM org.alfresco.solr.query.AbstractQParser getSearchParameters
      FINE: {"textAttributes":[],"authorities":["GROUP_ALFRESCO_ADMINISTRATORS","GROUP_EMAIL_CONTRIBUTORS","GROUP_EVERYONE","GROUP_site_swsdp","GROUP_site_swsdp_SiteManager","ROLE_ADMINISTRATOR","ROLE_AUTHENTICATED","admin"],"templates":[],"allAttributes":[],"tenants":[""],"query":"(
      @

      {http\\://www.alfresco.org/model/content/1.0\\}

      description:\"description0001\" @

      {http\\://www.alfresco.org/model/content/1.0\\}

      title:\"title0001\"
      AND (( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      content\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" ))) ( TYPE:\"

      {http://www.alfresco.org/model/content/1.0}

      folder\" AND ((@

      {http\\://www.alfresco.org/model/content/1.0\\}

      name:\"text0001\" TEXT:\"text0001\" ))))) AND NOT ASPECT:\"sys:hidden\" ","locales":["en_US"],"defaultNamespace":"http://www.alfresco.org/model/content/1.0","defaultFTSOperator":"OR","defaultFTSFieldOperator":"OR"}

      Analysis to date
      1. Customer is considering developing a custom solution, and educate customers. Still, this is an issue.
      2. 4.1.1

        Attachments

          Structure

            Activity

              People

              • Assignee:
                closedissues Closed Issues
                Reporter:
                lcolorado Luis Colorado [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours
                  6h

                    Structure Helper Panel