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

Can't change location_rpt field definition

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 8.11
    • None
    • Schema and Analysis
    • None

    Description

      The problem

      I'm trying to delete the following properties from the location_rpt field, but the schema api are ineffective:

      • omitNorms,
      • omitTermFreqAndPositions
      • termPositions
      • omitPositions
      • termOffsets

      Why I'm doing that

      My objective is to remove some warnings as (see https://issues.apache.org/jira/browse/SOLR-15333 ) :

      • FieldType SpatialRecursivePrefixTreeFieldType does not allow termOffsets to be specified in schema,​ hardcoded behavior is termOffsets=false
      • FieldType SpatialRecursivePrefixTreeFieldType does not allow termPositions to be specified in schema,​ hardcoded behavior is termPositions=false

      From what I understand I need to remove those properties to let Solr use the default value

      How I'm doing that

      I'm using schema api for both creating my schema (after copying the default config) and editing the _location_rpt field type.

      The default managed-schema I'm copying as a base:

      <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType" geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers"/>

      Note: the properties I'm trying to remove are not present.

      The field definition before my changes:

       

      $ curl http://localhost:8983/api/collections/my_collection/schema/fieldtypes/location_rpt
      
      {
        "responseHeader":{
          "status":0,
          "QTime":1},
        "fieldType":{
          "name":"location_rpt",
          "class":"solr.SpatialRecursivePrefixTreeFieldType",
          "geo":"true",
          "omitNorms":true,
          "omitTermFreqAndPositions":true,
          "maxDistErr":"0.001",
          "termOffsets":false,
          "distErrPct":"0.025",
          "distanceUnits":"kilometers",
          "termPositions":false,
          "omitPositions":true}}
      

      My changes through schema api (I'm replacing the whole field definition, omitting the properties I don't want) :

       

      $ curl -X POST -H 'Content-type:application/json' --data-binary '{
        "replace-field-type":{
           "name":"location_rpt",
           "class": "solr.SpatialRecursivePrefixTreeFieldType",
           "geo": "true",
           "maxDistErr": "2",
           "distErrPct": "3",
           "distanceUnits": "kilometers"}
      }' http://localhost:8983/api/collections/my_collection/schema
      
      {
        "responseHeader":{
          "status":0,
          "QTime":442}}
       

      Note: I changed other values (maxDistErr and distErrPct) to see if changes took effect

      The current field definition:

      $ curl http://localhost:8983/api/collections/my_collection/schema/fieldtypes/location_rpt
      
      {
        "responseHeader":{
          "status":0,
          "QTime":0},
        "fieldType":{
          "name":"location_rpt",
          "class":"solr.SpatialRecursivePrefixTreeFieldType",
          "geo":"true",
          "omitNorms":true,
          "omitTermFreqAndPositions":true,
          "maxDistErr":"2",
          "termOffsets":false,
          "distErrPct":"3",
          "distanceUnits":"kilometers",
          "termPositions":false,
          "omitPositions":true}}
      

      The properties to be deleted are still present, but the other properties value has changed.

       

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            simone-bid Simone

            Dates

              Created:
              Updated:

              Slack

                Issue deployment