# Understanding elasticsearch and index creation

**URL:** <https://discuss.elastic.co/t/understanding-elasticsearch-and-index-creation/116376>\
**Category:** Elasticsearch\
**Created:** [January 21, 2018, 9:30am UTC](https://discuss.elastic.co/t/understanding-elasticsearch-and-index-creation/116376 "2018-01-21T09:30:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abkrim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abkrim/32/20217_2.png) [@abkrim](https://discuss.elastic.co/u/abkrim)\
**Post date:** [January 21, 2018, 9:30am UTC](https://discuss.elastic.co/t/understanding-elasticsearch-and-index-creation/116376/1 "2018-01-21T09:30:30Z")

</div>

I currently use Elasticsearch with a normalized data model. But now I am presented with a project, with other characteristics, and I can not see without it or how to work with it.

The problem is that there is no fixed format in the data of millions of documents, in which according to their category one of the fields, features, is a json that can contain different data on "features" .

Example (only put data of "features" rest of data is same.

```
    {
	"transaction": "Rent"
	"state": "Good state"
	"rooms": 2,
	"size": 250,
	"bathrooms": 2,
	"energy_class": "C"
	"appointments": "furnished"
	"floor": 'first'
	"banks": false,
	"features": [
		"air conditioning", "gasoil heating", "stoneware", "washing machine", "dishwasher"
	]
}

{
	"transaction": "Sold"
	"state": "Good state"
	"size": 250000,
	"fence": "cinegetic",
	"houses": [
		"0" => [
			"type" => "Main house",
			"size" => 350
			"rooms" => 5
			"bathrooms" => 2
		],
		"1" => [
			"type" => "House service",
			"size" => 100
			"rooms" => 2
			"bathrooms" => 1
		],
	]
	"banks": false,
	"features": [
		"water sources", "river", "solar panels"
	]
}

```

Of course, I need, search by keywords content in "features" array object.

On my latest experience, if declare a index, all data must be with same compositions. (data types)

Any ideas, or post with some doc for this question?

---

<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:** [January 21, 2018, 9:48am UTC](https://discuss.elastic.co/t/understanding-elasticsearch-and-index-creation/116376/2 "2018-01-21T09:48:05Z")

</div>

Fields must have the same type indeed. But documents can have different fields.

What is exactly the problem?

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

---

<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 18, 2018, 9:48am UTC](https://discuss.elastic.co/t/understanding-elasticsearch-and-index-creation/116376/3 "2018-02-18T09:48:13Z")

</div>

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