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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.3, 6.0
    • Component/s: Schema and Analysis
    • Labels:
      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
          Steve Rowe
        2. SOLR-7679.patch
          6 kB
          Marius Grama
        3. SOLR-7679.patch
          1 kB
          Marius Grama

          Issue Links

            Activity

              People

              • Assignee:
                steve_rowe Steve Rowe
                Reporter:
                mariusneo Marius Grama
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: