Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-5476

Rule key search should be case insensitive

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.4
    • Fix Version/s: 5.5
    • Component/s: ElasticSearch, Rules
    • Labels:

      Description

      e.g. make a search for "s1601" work just as well as one for "S1601".

      Actually the columns plugin_rule_key and plugin_config_key are not indexed and analyzed to resolve the query with the case insensitive feature.
      To do that , first we must analyse the fields with the following analyzers :

       "fields": {
                 "words": {
                               "search_analyzer": "search_words",
                               "index_analyzer": "index_words",
                                "type": "string"
      }
      }
      

      Second action , we need to modify the structure of the query to include the fields plugin_rule_key and pluging_config_key in the simple_query_string :

      {
                           "simple_query_string": {
                              "query": "XXXXXX",
                              "fields": [
                                 "name.words^20.0",
                                 "htmlDesc.words^3.0",
                                 "plugin_config_key.words^20.0",
                                 "plugin_rule_key.words^20.0",
                              ],
                              "default_operator": "and"
                           }
                        }
      

      I specified a boost 20 for these fields, this point could be discussed.

        Attachments

          Activity

            People

            Assignee:
            eric.duquesnoy Eric Duquesnoy (Inactive)
            Reporter:
            ganncamp OLD - GAC
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: