Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-43405

Wildcards not supported in phrases.

    XMLWordPrintable

    Details

    • UIS:
      1
    • Support reference count:
      7
    • Feedback Policy:
      We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      To Reproduce:
      Set com.atlassian.jira.issue.search.providers to DEBUG to see how JIRA converts JQL into Lucene queries.

      Create two issues with summaries:
      Placer One: MBL-RFT-00063
      Placer One: MBL-RFTO-000045
      MBL-
      Search in navigator:
      summary ~ "\"Placer One: MBL-*\""
      Converted Lucene query:
      +pq_support_summary:"Placer One MBL"

      Results:
      As you can see above, JIRA actually removes the Wildcard character when generating the Lucene query.
      The removal of the Wildcard character makes sense because Lucene does not support wild card searches for phrases. See official lucene documentation for reference.

      • Wildcard Searches
        Lucene supports single and multiple character wildcard searches within single terms (not within phrase queries).

      When you put \" \" it forces JIRA to convert the search as a phrase, instead of individual terms. The phrase "Placer One: MBL" matches the ticket's summary.

      MBL-R
      Search in navigator:
      summary ~ "\"Placer One: MBL-R*\""

      Converted Lucene query:
      +pq_support_summary:"Placer One MBL R"

      Again, notice how JIRA removes the wildcard character as its not supported.
      This search fails because the phrase "Placer One MBL R" doesn't match the ticket summary. (that extra a without the -!)

      Workaround:
      One workaround is to search on a per-term basis (so wild cards can be used) instead of searching with an entire phrase. So you need to remove the escaped inverted commas.
      Here's some sample JQL that successfully returns the issues:
      summary ~ "Placer One MBL R*"
      summary ~ "Placer One MBL RT*"
      summary ~ "Placer One M* R*"
      summary ~ "Placer One M* RFT*"

      Notice how removing the \" \" from the search tells Lucene to search on a per-term basis, allowing us to use the trailing wildcard characters.

      Suggestion:
      This is fixed in Lucene 4.8.0 JIRA 6.4 is on Lucene 3.3.0. In future versions use 4.8.0 to allow for more dynamic search functions with JQL.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jcastro Jose Castro (Inactive)
              Votes:
              10 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: