Duplicate field - Plugin custom

Hi guys, I have an error when creating the new CampoMapa that is specified in the add-on I'm working on. It tells me that the field is created duplicated. Any idea why it can be?

Query JSON

PUT example_event
{
    "settings": {
        "index": {
            "number_of_shards": 1,
            "number_of_replicas": 0
        }
    },
    "mappings": {
        "event": {
            "properties": {
                "recurrent_date": {
                    "type": "recurring"
                }
            }
        }
    }
}

Error

{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "Failed to parse content to map",
        "suppressed": [
          {
            "type": "illegal_state_exception",
            "reason": "Failed to close the XContentBuilder"
          }
        ]
      }
    ],
    "type": "parse_exception",
    "reason": "Failed to parse content to map",
    "caused_by": {
      "type": "json_parse_exception",
      "reason": "Duplicate field 'recurrent_date'\n at [Source: org.elasticsearch.common.compress.DeflateCompressor$1@4d2e4bef; line: 1, column: 159]"
    },
    "suppressed": [
      {
        "type": "illegal_state_exception",
        "reason": "Failed to close the XContentBuilder",
        "caused_by": {
          "type": "i_o_exception",
          "reason": "Unclosed object or array found"
        }
      }
    ]
  },
  "status": 400
}

Hey,

I assume you wrote your own mapper. Is it possible that this mapper is not fully consuming the supplied JSON data or too much of it when parsing the mapping type configuration?

--Alex

Thanks! :smiley:

Hello, I am creating a custom plugin and when making this query I have this error.

JSON

GET example_event/_search
{
  "query": {
    "bool" : {
      "filter" : {
        "script" : {
          "script" : {
            "source": "notHasExpired",
            "lang": "native",
            "params": {
              "field": "recurrent_date"
            }
          }
        }
      }
    }
  }
}

Error

"caused_by": {
      "type": "general_script_exception",
      "reason": "Failed to compile inline script [notHasExpired] using lang [native]",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "native scripts can not be used for context [filter]"
      }
    }

If code

if (context.equals(SearchScript.CONTEXT) == false) {
                //throw new IllegalArgumentException(getType() + " scripts cannot be used for context [" + context.name + "]");
            }

where compile receives
ScriptName: notHasExpired
scriptSource: notHasExpired
ContextType: native
ContextName: filter
SearchScript.CONTEXT: org.elasticsearch.script.ScriptContext@3e5d4f6b

if I delete the condition of "SearchScript.CONTEXT == false" I have an error of "org.elasticsearch.script.FilterScript $ Factory" but I am using it is "SearchScript.Factory factory = hasAnyOccurrenceBetween :: new;"

Do you have any idea why?

Hello brot. can you help me with this please! :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.