Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-14641

Impossible to distinguish between a space and an underscore in a search query

      We just started using Jira here (3.11). We have thousands of commonly used terms
      in our company that have underscores in them and so a high percentage of our search
      queries will contain underscores. It is currently impossible for us to do these searches in
      Jira.

      Jira seems to treat the underscore character to be identical to a space character.
      For instance if I want to do a search that will match all words that start with "abc_",
      I get the following results.

      Search for:
      abc_
      Matches:
      abc_def (correct)
      abc_hij (correct)
      abc klm (wrong)
      abc def (wrong)

      Search for:
      "abc_"
      Matches:
      abc_def (correct)
      abc_hij (correct)
      abc klm (wrong)
      abc def (wrong)

      Search for:
      "abc_def"
      Matches:
      abc_def (correct)
      abc def (wrong)

      Search for:
      "abc def"
      Matches:
      abc_def (wrong)
      abc def (correct)

      I looked at the Lucene documentation, but underscore is not one of their reserved
      characters, so it appears that this behavior is coming from somewhere inside Jira.

            [JRASERVER-14641] Impossible to distinguish between a space and an underscore in a search query

            The issue is still happening in one case I tested.

            For example:

            text~\"Search_Item\"

            -It doesn't happen when doing the search inside Jira (by selecting jql search instead of basic)

            I type in the search box: text~\"Search_Item\"

            and it works as intended.

             

            -It doesn't happen when using the Rest API, and having it as Url arguments, for example:

            https://Jira.net/rest/api/3/search/?jql=text~\"Search_Item\"

            GET http method

            works as intended.

             

            It however happens when doing a POST method, maybe something with my setup, or might be a bug in Jira

            but I do get the issue when using POST.

            For example:

            {"jql": "text~\"Search_Item\""}

            The issue happens.

            Ali Jakamy added a comment - The issue is still happening in one case I tested. For example: text~\"Search_Item\" -It doesn't happen when doing the search inside Jira (by selecting jql search instead of basic) I type in the search box: text~\"Search_Item\" and it works as intended.   -It doesn't happen when using the Rest API, and having it as Url arguments, for example: https://Jira.net/rest/api/3/search/?jql=text~\ "Search_Item\" GET http method works as intended.   It however happens when doing a POST method, maybe something with my setup, or might be a bug in Jira but I do get the issue when using POST. For example: {"jql": "text~\"Search_Item\""} The issue happens.

            This ticket should not have been closed.  The exact match method that was fixed in 6.2.3 does still not cater for the main subject of this ticket, which is that the underscore character is still considered as a space in the searching in JIRA.

            Yes, as search such as:

            summary ~ "\"full screen\"" will return only issues that match that exact text, no stemming will be done and stopwords will not be removed.

            is true, but a search for:

            summary ~ "\"full_screen\"" will find summaries that don't contain the underscore.

            Therefore, still not solved.

            Roger Hughes added a comment - This ticket should not have been closed.  The exact match method that was fixed in 6.2.3 does still not cater for the main subject of this ticket, which is that the underscore character is still considered as a space in the searching in JIRA. Yes, as search such as: summary ~ "\"full screen\"" will return only issues that match that exact text, no stemming will be done and stopwords will not be removed. is true, but a search for: summary ~ "\"full_screen\"" will find summaries that don't contain the underscore. Therefore, still not solved.
            Bugfix Automation Bot made changes -
            Minimum Version New: 3.11
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2845507 ] New: JAC Bug Workflow v3 [ 2918458 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v7 - Restricted [ 2584942 ] New: JAC Bug Workflow v2 [ 2845507 ]
            Ignat (Inactive) made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v6 - Restricted [ 1544112 ] New: JIRA Bug Workflow w Kanban v7 - Restricted [ 2584942 ]
            Confluence Escalation Bot (Inactive) made changes -
            Labels Original: hedge matching New: affects-server hedge matching
            Oswaldo Hernandez (Inactive) made changes -
            Component/s New: Infrastructure & Services - Indexing [ 43408 ]
            Component/s Original: Filtering & Indexing [Deprecated] [ 10231 ]
            Owen made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v6 [ 679890 ] New: JIRA Bug Workflow w Kanban v6 - Restricted [ 1544112 ]

            Hi cameron.fowler,

            The improvements described in my [https://jira.atlassian.com/browse/JRA-14641?focusedCommentId=716064&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-716064|comment above] have been delivered in JIRA 6.2.3 and above. Hence, the fix version on this issue of "6.2.3".

            Hope that helps

            Regards,

            Oswaldo Hernández.
            JIRA Bugmaster.
            [Atlassian].

            Oswaldo Hernandez (Inactive) added a comment - Hi cameron.fowler , The improvements described in my [https://jira.atlassian.com/browse/JRA-14641?focusedCommentId=716064&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-716064|comment above] have been delivered in JIRA 6.2.3 and above. Hence, the fix version on this issue of "6.2.3". Hope that helps Regards, Oswaldo Hernández. JIRA Bugmaster. [Atlassian] .

              Unassigned Unassigned
              3f85ab128771 G B
              Affected customers:
              36 This affects my team
              Watchers:
              31 Start watching this issue

                Created:
                Updated:
                Resolved: