# ES SQL custom mappings

**URL:** <https://discuss.elastic.co/t/es-sql-custom-mappings/349980>\
**Category:** Elasticsearch\
**Created:** [December 26, 2023, 5:24pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980 "2023-12-26T17:24:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ES\_SQL\_HELP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/es_sql_help/32/122551_2.png) [@ES\_SQL\_HELP](https://discuss.elastic.co/u/ES_SQL_HELP)\
**Post date:** [December 26, 2023, 5:24pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/1 "2023-12-26T17:24:28Z")

</div>

Hello, I'm wondering if it's possible to use ES SQL on custom field mappings for types e.g. long, integer, doubles.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 26, 2023, 6:10pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/2 "2023-12-26T18:10:17Z")

</div>

Hi @ES_SQL_HELP Welcome to the community.

Just to be

ES|QL- Elasticsearch Piped Query Language

> **[ES|QL | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html)**

Or SQL - SQL API

> **[SQL | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-sql.html)**

And can you provide an example of what you are trying to do?

---

<div class="post-metadata">

**Author:** ![ES\_SQL\_HELP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/es_sql_help/32/122551_2.png) [@ES\_SQL\_HELP](https://discuss.elastic.co/u/ES_SQL_HELP)\
**Post date:** [December 27, 2023, 3:25pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/3 "2023-12-27T15:25:00Z")

</div>

Thanks for the response, it's the latter SQL- SQL API.

Investigating into transforming existing term/range queries to SQL type queries but on custom types.

`SELECT id FROM index WHERE id > 100` but assuming that the `id` field here has a custom type mapping that was generated from a plugin e.g. custom\_integer

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 27, 2023, 4:21pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/4 "2023-12-27T16:21:42Z")

</div>

> [@ES\_SQL\_HELP](#):
>
> `SELECT id FROM index WHERE id > 100` but assuming that the `id` field here has a custom type mapping that was generated from a plugin e.g. custom\_integer

I do not know what you mean by a custom mapping... you would need to provide example but sure that will work with a `long` or `integer `

---

<div class="post-metadata">

**Author:** ![ES\_SQL\_HELP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/es_sql_help/32/122551_2.png) [@ES\_SQL\_HELP](https://discuss.elastic.co/u/ES_SQL_HELP)\
**Post date:** [December 27, 2023, 4:43pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/5 "2023-12-27T16:43:52Z")

</div>

Ah sorry, I'm referring to a custom field type that we generate from a plugin.

Such as from this post: [Custom field type?](https://discuss.elastic.co/t/custom-field-type/211751).

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 27, 2023, 4:52pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/6 "2023-12-27T16:52:18Z")

</div>

I don't know the answer to that. I guess you're just going to have to try it 🙂

Ohh and welcome to the community!

Let's us know what you find out!

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [January 3, 2024, 5:08pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/7 "2024-01-03T17:08:54Z")

</div>

Custom field types are not supported.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 31, 2024, 5:09pm UTC](https://discuss.elastic.co/t/es-sql-custom-mappings/349980/8 "2024-01-31T17:09:07Z")

</div>

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