0
votes

I am encountering a problem while I indexing some data into ElasticSearch

Here is the context. I want to index below content into elastic search as below, and in which has a [value] named field:

// source#invokingMethods
{
            "appName": "mytest1",
            "businessInfo": "pay",
            "className": "com.mytest.biz.pay.SinglePayProcessor",
            "id": "mytest1516625397380",
            "methodName": "validatePayRequest",
            "properties": {},
            "version": "17855",
            "desc": true,
            "key": 17855,
            "value": "11-aa"
 }

When I indexing, I got an exception from ES server: "type": "mapper_parsing_exception", "reason": "failed to parse [invokingMethods.value]", "caused_by": { "type": "illegal_argument_exception", "reason": "Failed to parse value [11-aa] as only [true] or [false] are allowed." }

Is the [value] field a preserved field in ES, and it could not be parsed in boolean type?

Any feedback will be highly appreciated.

1
Can you share the mapping of the index?sammy
Thanks Sammy. I just checked mapping of the index, the field of [value] is: , "value": { "type": "boolean" }, But I have no idea when or how I specifically set it into boolean type. Is this the reason the [value] field only support boolean value while indexing?Z.Daniel
I would think so. Try deleting the index and re-creating the index with new mapping.sammy
I tried and succeed! The mapping of this field is changed to text, so it's able to handle almost all kinds of types. :) Thanks Sammy.Z.Daniel
You might not have specifically set it to boolean but Elasticsearch implicitly figures out a mapping type when you first put a document. I am guessing the value for "value" for the first document you put could have led ES to interpret it as a boolean type.sammy

1 Answers

0
votes

You might not have specifically set it to boolean but Elasticsearch implicitly figures out a mapping type when you first put a document. I am guessing the value for "value" for the first document you put could have led ES to interpret it as a boolean type.

Try deleting the index and re-creating the index with new mapping.