# Getting a no\_viable\_alt\_exception only when trying to filter using a scripted field

**URL:** <https://discuss.elastic.co/t/getting-a-no-viable-alt-exception-only-when-trying-to-filter-using-a-scripted-field/183145>\
**Category:** Kibana\
**Tags:** painless\
**Created:** [May 28, 2019, 4:23pm UTC](https://discuss.elastic.co/t/getting-a-no-viable-alt-exception-only-when-trying-to-filter-using-a-scripted-field/183145 "2019-05-28T16:23:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ebalmeida](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebalmeida/32/47103_2.png) [@ebalmeida](https://discuss.elastic.co/u/ebalmeida)\
**Post date:** [May 28, 2019, 6:18pm UTC](https://discuss.elastic.co/t/getting-a-no-viable-alt-exception-only-when-trying-to-filter-using-a-scripted-field/183145/3 "2019-05-28T18:18:38Z")

</div>

Hi Larry,

The data itself is, unfortunately, quite sensitive. I can, however, send the mapping, no problem.

```
{
  "mapping": {
    "data": {
      "properties": {
        "data_registrado_contrato": {
          "type": "date"
        },
        "data_vigencia_fim": {
          "type": "date"
        },
        "data_vigencia_inicio": {
          "type": "date"
        },
        "departamento": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "departamento_ec": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "dois_ou_mais_shoppings": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "empresa": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "id": {
          "type": "float"
        },
        "id_contrato": {
          "type": "float"
        },
        "instrumentos": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "lista_tarefas": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword"
            }
          }
        },
        "loja_ancora": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "nome_outras_partes": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "nome_parte_ativa": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "nome_parte_passiva": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "origem_da_solicitacao": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "qtde_de_instrumentos": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "solicitante_responsavel": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "status_contrato": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "tipo_do_contrato": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "valor_contrato_total": {
          "type": "float"
        }
      }
    }
  }
}

```

As for lista\_tarefas, which the script directly references, it comes in this format:  
DD-MMM-YY hh.mm.ss.aaaZZZ AM/PM; DD-MMM-YY hh.mm.ss.aaaZZZ AM/PM; DD-MMM-YY hh.mm.ss.aaaZZZ AM/PM; "Task Id Number"; "Task Type"; "Status code" | Next task | Next task...

For example:

> 27-MAY-19 07.27.16.441000 PM;03-JUN-19 07.27.16.397000 PM;27-MAY-19 07.35.39.056000 PM;197773;Task Type A;2 | 27-MAY-19 07.35.39.109000 PM;27-MAY-19 07.35.39.070000 PM;27-MAY-19 07.35.52.245000 PM;197815;Task Type B;2 | 27-MAY-19 07.35.52.339000 PM;08-JUL-19 07.35.52.263000 PM;N/A;197816;Task Type C;1

Thank you so very much for looking into it.

---

_[View the full topic](https://discuss.elastic.co/t/getting-a-no-viable-alt-exception-only-when-trying-to-filter-using-a-scripted-field/183145)._
