Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7679

Schema API doesn't take similarity attribute into account when adding field types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.2
    • 5.3, 6.0
    • Schema and Analysis
    • None

    Description

      When using the request

      curl -X POST -H 'Content-type:application/json' --data-binary '{
        "add-field-type": {
          "name": "fieldTypeWithSimilarity",
          "class": "org.apache.solr.schema.TextField",
          "analyzer": {
            "charFilters": [
              {
                "class": "solr.PatternReplaceCharFilterFactory",
                "replacement": "$1$1",
                "pattern": "([a-zA-Z])\\\\1+"
              }
            ],
            "tokenizer": {
              "class": "solr.WhitespaceTokenizerFactory"
            }
          },
          "similarity": {
            "class": "org.apache.lucene.misc.SweetSpotSimilarity"
          }
        }
      }' http://localhost:8983/solr/gettingstarted/schema
      
      

      can be seen in the updated schema.xml that the similarity attributes for the newly added field type doesn't contain a similarity entry.
      This is due to the fact that within FieldTypeXmlAdapter the similiarity element is not being added to the field type.

      Attachments

        1. SOLR-7679.patch
          5 kB
          Steven Rowe
        2. SOLR-7679.patch
          6 kB
          Marius Grama
        3. SOLR-7679.patch
          1 kB
          Marius Grama

        Issue Links

          Activity

            People

              sarowe Steven Rowe
              mariusneo Marius Grama
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: