# Reindexing: Can't parse boolean value \[{format=disabled}\], expected \[true\] or \[false\]

**URL:** <https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823>\
**Category:** Elasticsearch\
**Created:** [March 31, 2017, 2:06pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823 "2017-03-31T14:06:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [March 31, 2017, 2:06pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/1 "2017-03-31T14:06:06Z")

</div>

I got the following error when I try to reindex from v4 to v5. [edit] v2 to v5

Can't parse boolean value [{format=disabled}], expected [true] or [false]

There should no be any boolean value, I can confirm it when I get the mappings from version 4.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2017, 2:19pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/2 "2017-03-31T14:19:28Z")

</div>

Version 4 of elasticsearch does not exist.

Can you give more detail on what you are doing exactly? Which commands?

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [March 31, 2017, 2:25pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/3 "2017-03-31T14:25:36Z")

</div>

RE-INDEX

```
POST _reindex
{ 
  "source":
  {   
    "index": "logfile-2017.01" 
  }, 
  "dest":
  {   
    "index": "2017.01-1" 
  }
}

```

getting mapping (source index)

`get /logfile-2017.01/_mappings`

Error:

```
  "cause": {
    "type": "mapper_parsing_exception",
    "reason": "failed to parse",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "Can't parse boolean value [{format=disabled}], expected [true] or [false]"
    }
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2017, 2:42pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/4 "2017-03-31T14:42:11Z")

</div>

So when you call `GET _mapping` you are getting this error?

Or you are getting this error when you call `_reindex` API?

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [March 31, 2017, 2:45pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/5 "2017-03-31T14:45:17Z")

</div>

when I call \_reindex

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2017, 2:46pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/6 "2017-03-31T14:46:16Z")

</div>

But reindex does not push any mapping AFAIK. Can you post the full error? And elasticsearch logs?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2017, 2:47pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/7 "2017-03-31T14:47:38Z")

</div>

Hmmm. Actually I think I understand.

You are probably using dynamic mapping. You have a first document which comes with `format: true` then a second one with `format: disabled`. Am I correct?

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [March 31, 2017, 2:57pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/8 "2017-03-31T14:57:16Z")

</div>

I dont see any format field under dynamic\_fields-\>boolean\_fields

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [March 31, 2017, 3:05pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/9 "2017-03-31T15:05:40Z")

</div>

I have explicited added but I go the same error:

```
        "boolean_fields": {
          "match": "*",
          "match_mapping_type": "boolean",
          "mapping": {
            "fielddata": {
              "format": "true"
            },
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            },
            "norms": false,
            "type": "text"
          }
        }
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2017, 3:10pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/10 "2017-03-31T15:10:09Z")

</div>

That's not what I'm saying.

Do you have a field named `format` in your old index?  
If so, for the mapping of the target index to be a `keyword` for this field instead of a `boolean` and try to reindex again.

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [March 31, 2017, 3:15pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/11 "2017-03-31T15:15:46Z")

</div>

there is no field named `format`....

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2017, 4:26pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/12 "2017-03-31T16:26:51Z")

</div>

Ok. Can you give please the result of `GET _template?pretty`, the result of `GET logfile-2017.01/_search?pretty&size=1`?

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [April 2, 2017, 6:01pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/13 "2017-04-02T18:01:31Z")

</div>

I expect to get a boolean field in the result of the old index mapping, but i cant see any boolean.

Furthermore there is no true/false value in any document.

Why does it complain about a boolean field?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 2, 2017, 6:12pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/14 "2017-04-02T18:12:35Z")

</div>

I don't know.

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [April 3, 2017, 7:42am UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/15 "2017-04-03T07:42:49Z")

</div>

I have posted below the requested outputs:

Output of `GET _templates`

```
"mappings": {
      "_default_": {
        "dynamic_templates": [
          {
            "message_field": {
              "path_match": "message",
              "mapping": {
                "norms": false,
                "type": "text"
              },
              "match_mapping_type": "string"
            }
          },
          {
            "string_fields": {
              "mapping": {
                "fielddata": true,
                "norms": false,
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "match_mapping_type": "string",
              "match": "*"
            }
          },
          {
            "boolean_fields": {
              "mapping": {
                "fielddata": true,
                "norms": false,
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword"
                  }
                }
              },
              "match_mapping_type": "boolean",
              "match": "*"
            }
          }
        ],
        "_all": {
          "norms": false,
          "enabled": true
        },
        "properties": {
          "@timestamp": {
            "include_in_all": false,
            "type": "date"
          },
          "geoip": {
            "dynamic": true,
            "properties": {
              "ip": {
                "type": "ip"
              },
              "latitude": {
                "type": "half_float"
              },
              "location": {
                "type": "geo_point"
              },
              "longitude": {
                "type": "half_float"
              }
            }
          },
          "logdate": {
            "type": "date"
          }
        }
      }
    },
    "aliases": {
      "logfiles": {}
    }
  }

```

Output from `_search`

```
{
  "took": 7,
  "timed_out": false,
  "_shards": {
    "total": 2,
    "successful": 2,
    "failed": 0
  },
  "hits": {
    "total": 316403,
    "max_score": 1,
    "hits": [
      {
        "_index": "logfile-2017.01",
        "_type": "logs",
        "_id": "AVnaJ09QlJpm_17whLrF",
        "_score": 1,
        "_source": {
          "message": "value_1 | 2017-01-02 07:28:47,457 aaa traffic from 127.0.0.1: {'function_code': None, 'slave_id': 22, 'request': '111111111111', 'response': ''} (d0dd7fba-61c1-4d96-9de0-0e0846a482a7)",
          "@version": "1",
          "@timestamp": "2017-01-02T06:28:47.457Z",
          "tags": [
            "logs",
            "beats_input_codec_plain_applied",
            "_grokparsefailure"
          ],
          "source": "logs.log",
          "input_type": "log",
          "offset": 2243301,
          "type": "logs",
          "beat": {
            "name": "machine1",
            "hostname": "machine1",
            "version": "5.1.1"
          },
          "host": "machine1",
          "color": "value_1",
          "time": "2017-01-02 07:28:47,457",
          "names": "aaa",
          "parameters": "None",
          "numbers": "22",
          "codes": "111111111111",
          "uuid": "d0dd7fba-61c1-4d96-9de0-0e0846a482a7",
          "cities": "from",
          "ips": "127.0.0.1"
        }
      }
    ]
  }
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 3, 2017, 8:23am UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/16 "2017-04-03T08:23:36Z")

</div>

Thanks.

Can you run this:

```auto
GET /_search
{
    "query": {
        "exists" : { "field" : "format" }
    }
}

```

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [April 3, 2017, 8:36am UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/17 "2017-04-03T08:36:30Z")

</div>

```
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 2,
    "successful": 2,
    "failed": 0
  },
  "hits": {
    "total": 0,
    "max_score": null,
    "hits": []
  }
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 3, 2017, 10:37am UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/18 "2017-04-03T10:37:41Z")

</div>

I have no idea. @nik9000 Does this ring a bell?

---

<div class="post-metadata">

**Author:** ![dcam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dcam/32/51518_2.png) [@dcam](https://discuss.elastic.co/u/dcam)\
**Post date:** [April 3, 2017, 12:36pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/19 "2017-04-03T12:36:37Z")

</div>

We can close this issue. There was an old template, which it should ve been deleted before calling re-index API.'

Thx for the help

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 3, 2017, 1:30pm UTC](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823/20 "2017-04-03T13:30:19Z")

</div>

Where was it in GET \_templates?

Can't see it.

[Next page](https://discuss.elastic.co/t/reindexing-cant-parse-boolean-value-format-disabled-expected-true-or-false/80823.md?page=2)
