# Question about data types and adding new data types

**URL:** <https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928>\
**Category:** Elasticsearch\
**Created:** [January 10, 2022, 6:00pm UTC](https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928 "2022-01-10T18:00:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguel\_Lopez1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_lopez1/32/99085_2.png) [@Miguel\_Lopez1](https://discuss.elastic.co/u/Miguel_Lopez1)\
**Post date:** [January 10, 2022, 6:00pm UTC](https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928/1 "2022-01-10T18:00:34Z")

</div>

Hi,

As part of a masters degree assignment I need to address some questions about the Elasticsearch to the developers. The question is:

I saw that Elasticsearch is capable of working with a variety of data types (for indexing and searching) and I am interested about how it works behind the scene, specifically about how would Elasticsearch adapt to new kinds of data in the future.

If you can't answer my question, do you know anywhere where I can get this information from?

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 10, 2022, 9:02pm UTC](https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928/2 "2022-01-10T21:02:34Z")

</div>

What do you mean by new kinds of data?

---

<div class="post-metadata">

**Author:** ![Miguel\_Lopez1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_lopez1/32/99085_2.png) [@Miguel\_Lopez1](https://discuss.elastic.co/u/Miguel_Lopez1)\
**Post date:** [January 11, 2022, 11:47am UTC](https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928/3 "2022-01-11T11:47:21Z")

</div>

By kinds of data I mean field data types: [Field data types | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html)

So if I wanted to add support to a new custom data type so I can index it and use it on queries, how would I have to extend the code to allow this? Is it easy?

For example, if the geo\_point data type didn't exist, what steps should be taken to add it?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 11, 2022, 12:08pm UTC](https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928/4 "2022-01-11T12:08:31Z")

</div>

The best thing to do would be to look at one of our existing plugins e.g. the [annotated text](https://github.com/elastic/elasticsearch/tree/master/plugins/mapper-annotated-text) field type and use the source as a template for your new field.  
The basis of it is you define a plugin that registers itself in a field types registry. The base class MappedFieldType has methods that must be overwritten when creating documents or queries related to your custom field type.

---

<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:** [February 8, 2022, 12:09pm UTC](https://discuss.elastic.co/t/question-about-data-types-and-adding-new-data-types/293928/5 "2022-02-08T12:09:15Z")

</div>

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