# Prefix type Search which datatype should choose

**URL:** https://discuss.elastic.co/t/prefix-type-search-which-datatype-should-choose/356592
**Category:** Elasticsearch
**Created:** [April 2, 2024, 6:49am UTC](https://discuss.elastic.co/t/prefix-type-search-which-datatype-should-choose/356592 "2024-04-02T06:49:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)
#### Post date: [April 2, 2024, 6:49am UTC](https://discuss.elastic.co/t/prefix-type-search-which-datatype-should-choose/356592/1 "2024-04-02T06:49:07Z")

</div>

Hi Team,

For prefix type query search in Elasticsearch which datatype we should choose. It is known that the prefix type search has the capability to support both text and keyword.  
We need your help in determining the more suitable datatype between the two choices.

Thanks,  
Debasis

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 2, 2024, 7:34am UTC](https://discuss.elastic.co/t/prefix-type-search-which-datatype-should-choose/356592/2 "2024-04-02T07:34:32Z")

</div>

Different field types combined with query types give different search results, so the optimal combination for your use case will depend on your data and how you want to query or aggregate it in the future. By default the dynamic mappings in Elasticsearch map fields as both text and keyword which out of the box gives you the flexibility to query in different ways. This does take up more space on disk but is often a good starting point.

---

<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: [April 30, 2024, 7:34am UTC](https://discuss.elastic.co/t/prefix-type-search-which-datatype-should-choose/356592/3 "2024-04-30T07:34:50Z")

</div>

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