# Cloud elastic account,Reindex docs

**URL:** <https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177>\
**Category:** Elasticsearch\
**Created:** [August 7, 2019, 8:21am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177 "2019-08-07T08:21:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilyoskhuja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilyoskhuja/32/47524_2.png) [@Ilyoskhuja](https://discuss.elastic.co/u/Ilyoskhuja)\
**Post date:** [August 7, 2019, 8:21am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/1 "2019-08-07T08:21:14Z")

</div>

I use [cloud.elastic.co](http://cloud.elastic.co), my first account working (with reindexing docs and search) ,

 ![57](https://us1.discourse-cdn.com/elastic/original/3X/d/c/dcd3b7281b7c8546188668b87d184133b130f6c8.png)

but now I created new account with same version

 ![16](https://us1.discourse-cdn.com/elastic/original/3X/6/e/6ed046c39fb53a9198dab98ed532568686c45c12.png)

I didnt change reindexing code but i got error  
2019-08-06 22:56:40.131 +05:00 [Warning] Invalid NEST response built from a unsuccessful (400) low level call on POST: /atiruz/\_search?typed\_keys=true

```
# Audit trail of this API call:

* [1] BadResponse: Node: https://f87fd4280a7944--------cd160f6f03ee54.europe-west1.gcp.cloud.es.io:9243/ Took: 00:00:00.1334420

# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 400 from: POST /atiruz/_search?typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: "all shards failed"

# Request:

{"from":0,"query":{"bool":{"filter":[{"geo_bounding_box":{"_name":"Location","boost":1.1,"location":{"bottom_right":{"lat":41.23020955415123,"lon":69.34550008544922},"top_left":{"lat":41.368716908561794,"lon":69.13469991455077}}}]},"size":26,"sort":[{"createdDate":{"order":"desc"}}]}

# Response:

{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to find geo_point field [location]","index_uuid":"01aoWJJfSeSLyhgXJX-uIg","index":"atiruz"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"atiruz","node":"RELnlMkQRVWY5BXnJ91ngw","reason":{"type":"query_shard_exception","reason":"failed to find geo_point field [location]","index_uuid":"01aoWJJfSeSLyhgXJX-uIg","index":"atiruz"}}]},"status":400}

```

I tested with my first account same code , I reindex all docs and its working without any error, but when I reindex with my second account it cant reindex properly

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 7, 2019, 9:01pm UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/2 "2019-08-07T21:01:21Z")

</div>

The response indicates that the `"location"` field is missing in the index

> [@Ilyoskhuja](#):
>
> "reason":"failed to find geo\_point field [location]"

Can you show the mapping that exists in the index? You can get this by issuing

```auto
GET /atiruz

```

in Kibana Dev Console

---

<div class="post-metadata">

**Author:** ![Ilyoskhuja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilyoskhuja/32/47524_2.png) [@Ilyoskhuja](https://discuss.elastic.co/u/Ilyoskhuja)\
**Post date:** [August 8, 2019, 2:25am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/3 "2019-08-08T02:25:12Z")

</div>

```
{
* "took": 7,
* "timed_out": false,
* "_shards": {
    * "total": 5,
    * "successful": 5,
    * "skipped": 0,
    * "failed": 0
* },
* "hits": {
    * "total": {
        * "value": 1143,
        * "relation": "eq"
    * },
    * "max_score": 1,
    * "hits": [
        * {
            * "_index": ".kibana_1",
            * "_type": "_doc",
            * "_id": "space:default",
            * "_score": 1,
            * "_source": {
                * "space": {
                    * "name": "Default",
                    * "description": "This is your default space!",
                    * "color": "#00bfb3",
                    * "_reserved": true
                * },
                * "type": "space",
                * "references": [],
                * "updated_at": "2019-08-05T10:45:10.572Z"
            * }
        * }
        * ,
        * {
            * "_index": ".kibana_1",
            * "_type": "_doc",
            * "_id": "maps-telemetry:maps-telemetry",
            * "_score": 1,
            * "_source": {
                * "maps-telemetry": {
                    * "mapsTotalCount": 0,
                    * "timeCaptured": "2019-08-07T00:00:03.697Z",
                    * "attributesPerMap": {
                        * "dataSourcesCount": {
                            * "min": 0,
                            * "max": 0,
                            * "avg": 0
                        * },
                        * "layersCount": {
                            * "min": 0,
                            * "max": 0,
                            * "avg": 0
                        * },
                        * "layerTypesCount": { },
                        * "emsVectorLayersCount": { }
                    * }
                * },
                * "type": "maps-telemetry",
                * "references": [],
                * "updated_at": "2019-08-07T00:00:03.697Z"
            * }
        * }
        * ,
        * {
            * "_index": ".kibana_task_manager",
            * "_type": "_doc",
            * "_id": "oss_telemetry-vis_telemetry",
            * "_score": 1,
            * "_source": {
                * "type": "task",
                * "task": {
                    * "taskType": "vis_telemetry",
                    * "state": "{"runs":3}",
                    * "params": "{}",
                    * "attempts": 3,
                    * "scheduledAt": "2019-08-05T10:45:54.160Z",
                    * "runAt": "2019-08-08T00:00:00.000Z",
                    * "status": "idle"
                * },
                * "kibana": {
                    * "uuid": "69bdc359-ea65-4c48-8cd9-8c673e2a1a35",
                    * "version": 7010199,
                    * "apiVersion": 1
                * }
            * }
        * }
        * ,
        * {
            * "_index": ".kibana_task_manager",
            * "_type": "_doc",
            * "_id": "Maps-maps_telemetry",
            * "_score": 1,
            * "_source": {
                * "type": "task",
                * "task": {
                    * "taskType": "maps_telemetry",
                    * "state": "{"runs":1,"stats":{"mapsTotalCount":0,"timeCaptured":"2019-08-07T00:00:03.697Z","attributesPerMap":{"dataSourcesCount":{"min":0,"max":0,"avg":0},"layersCount":{"min":0,"max":0,"avg":0},"layerTypesCount":{},"emsVectorLayersCount":{}}}}",
                    * "params": "{}",
                    * "attempts": 0,
                    * "scheduledAt": "2019-08-05T10:45:52.473Z",
                    * "runAt": "2019-08-08T00:00:00.000Z",
                    * "status": "idle"
                * },
                * "kibana": {
                    * "uuid": "69bdc359-ea65-4c48-8cd9-8c673e2a1a35",
                    * "version": 7010199,
                    * "apiVersion": 1
                * }
            * }
        * }
        * ,
      
        * {
            * "_index": "atiruz",
            * "_type": "_doc",
            * "_id": "2793",
            * "_score": 1,
            * "_source": {
                * "location": {
                    * "lat": 41.29574805579102,
                    * "lon": 69.19265627861022
                * },
                * "id": 2793,
                * "buildTitle": "Продажа Квартиры: Район - Чиланзар Улица/Квартал - 14",
                * "createdDate": "2019-05-03T14:05:34.7268961",
                * "totalRooms": 3,
                * "description": "Продажа Квартиры: #Район - Чиланзар Улица/Квартал - 14 Ориентир - около дороги #Комнат - 3 Этаж - 2 Этажей - 4 Площадь м² - 65 Состояние - чистое Описание - балкон 1.5×3 #Цена - 33 000 $ Телефон - +998977338845",
                * "ownerPrice": 33000,
                * "size": 65,
                * "sizeName": "kv",
                * "moneyType": "Dollar",
                * "buildAction": "Sotiladi",
                * "buildType": "Kvartira",
                * "address": "#Район - Чиланзар Улица/Квартал - 14",
                * "buildingRooms": [
                    * {
                        * "roomType": 12,
                        * "roomCount": 2
                    * }
                    * ,
                    * {
                        * "roomType": 14,
                        * "roomCount": 1
                    * }
                * ],
                * "buildingPhotos": [
                    * {
                        * "title": "ec76d27c-445e-4cb6-a6da-ed7ab999c693.jpg",
                        * "path": "Storage/Building/Photo\bp1c3iio.mrp.jpg"
                    * }
                * ]
            * }
        * }
    * ]
* }
}

```

I created new index and everything is working, but I wonder, where is problem I used same code,why is happened?

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 8, 2019, 3:27am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/4 "2019-08-08T03:27:24Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel to help see what it looks like.

* * *

The response you've posted looks like search results. Please show the mapping that exists in the index `atiruz`, with

```auto
GET /atiruz

```

The response will look something like

```json
{
  "atiruz" : {
    "aliases" : { },
    "mappings" : {
      "properties" : {
        "acceptedAnswerId" : {
          "type" : "integer"
        },
        "answerCount" : {
          "type" : "integer"
        },
        "title" : {
          "type" : "text",
          "norms" : false,
          "fields" : {
            "raw" : {
              "type" : "keyword"
            }
          },
          "analyzer" : "expand"
        }
      }
    },
    "settings" : {
      "index" : {
        "refresh_interval" : "1s",
        "number_of_shards" : "3",
        "provided_name" : "posts",
        "creation_date" : "1565087735315",
        "analysis" : {
        }
      }
    }
  }
}

```

although the properties are going to be different in your case

---

<div class="post-metadata">

**Author:** ![Ilyoskhuja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilyoskhuja/32/47524_2.png) [@Ilyoskhuja](https://discuss.elastic.co/u/Ilyoskhuja)\
**Post date:** [August 9, 2019, 8:52pm UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/5 "2019-08-09T20:52:23Z")

</div>

```
{

* "atiruz": {
  * "mappings": {
    * "properties": {
      * "address": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "buildAction": {
        * "type": "integer"},
      * "buildTitle": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "buildType": {
        * "type": "integer"},
      * "buildingPhotos": {
        * "properties": {
          * "path": {
            * "type": "text",
            * "fields": {
              * "keyword": {
                * "type": "keyword",
                * "ignore_above": 256}}},
          * "title": {
            * "type": "text",
            * "fields": {
              * "keyword": {
                * "type": "keyword",
                * "ignore_above": 256}}}}},
      * "buildingRooms": {
        * "properties": {
          * "roomCount": {
            * "type": "integer"},
          * "roomType": {
            * "type": "integer"}}},
      * "createdDate": {
        * "type": "date"},
      * "description": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "districtRu": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "districtUz": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "id": {
        * "type": "integer"},
      * "location": {
        * "type": "geo_point"},
      * "moneyType": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "ownerPrice": {
        * "type": "double"},
      * "size": {
        * "type": "double"},
      * "sizeName": {
        * "type": "text",
        * "fields": {
          * "keyword": {
            * "type": "keyword",
            * "ignore_above": 256}}},
      * "totalRooms": {
        * "type": "integer"}}}}

}

```

Sometimes it doesn't create index with location field

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 12, 2019, 7:42am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/6 "2019-08-12T07:42:42Z")

</div>

> [@Ilyoskhuja](#):
>
> Sometimes it doesn't create index with location field

How are you creating the index? Can you please show the source code that you're using?

---

<div class="post-metadata">

**Author:** ![Ilyoskhuja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilyoskhuja/32/47524_2.png) [@Ilyoskhuja](https://discuss.elastic.co/u/Ilyoskhuja)\
**Post date:** [August 16, 2019, 4:43am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/7 "2019-08-16T04:43:51Z")

</div>

```
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

using Nest;
using XonadonUz.Models;

namespace XonadonUz
{public static class ElasticsearchExtensions
    {
        public static void AddElasticsearch(
            this IServiceCollection services, IConfiguration configuration)
        {
//honadon https:/----------------------------
            var url = configuration["https://f
            var defaultIndex ="======";
           
        // var defaultIndex = configuration["example_index"];
        // var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
var list = new List<string>();
            var settings = new ConnectionSettings(

                new Uri("https://f
                .DefaultIndex(defaultIndex)
                //honadon
              // .BasicAuthentication("=====", "=============")
                ///atiruz
                .BasicAuthentication("======", "==============")

                
                  
    .DisableDirectStreaming() 
    .OnRequestCompleted(apiCallDetails => 
    {
        // log out the request and the request body, if one exists for the type of request
        if (apiCallDetails.RequestBodyInBytes != null)
        {
            list.Add(
                $"{apiCallDetails.HttpMethod} {apiCallDetails.Uri} " +
                $"{Encoding.UTF8.GetString(apiCallDetails.RequestBodyInBytes)}");
        }
        else
        {
            list.Add($"{apiCallDetails.HttpMethod} {apiCallDetails.Uri}");
        }

        // log out the response and the response body, if one exists for the type of response
        if (apiCallDetails.ResponseBodyInBytes != null)
        {
            list.Add($"Status: {apiCallDetails.HttpStatusCode}" +
                     $"{Encoding.UTF8.GetString(apiCallDetails.ResponseBodyInBytes)}");
        }
        else
        {
            list.Add($"Status: {apiCallDetails.HttpStatusCode}");
        }
    });

            // AddDefaultMappings(settings);

            var client = new ElasticClient(settings);

            services.AddSingleton<IElasticClient>(client);

            CreateIndex(client, defaultIndex);
        }

        private static void AddDefaultMappings(ConnectionSettings settings)
        {
            settings
                .DefaultMappingFor<ElasticSearchModel>(m => m);
                   
        }

        private static void CreateIndex(IElasticClient client, string indexName)
        {
            var createIndexResponse = client.Indices.Create("honadonz12", c => c
                          .Map<ElasticSearchModel>(mm => mm
                         .AutoMap()
                            )
                            .RequestConfiguration(r => r
                            .DisableDirectStreaming()
    )
                  );

                   Console.WriteLine("Writeline is :" + createIndexResponse);
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 19, 2019, 6:53am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/8 "2019-08-19T06:53:44Z")

</div>

I think what may be happening here is that a document is sent to be indexed into an Elasticsearch index _before_ that index exists, which causes Elasticsearch to create the index and infer the mapping from the document it receives.

This behaviour can be changed to [not automatically create the index when a document is sent to be indexed](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation), and instead explicitly require the index be created beforehand, by updating cluster settings with

```json
PUT _cluster/settings
{
    "persistent": {
        "action.auto_create_index": "false" 
    }
}

```

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 19, 2019, 7:00am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/9 "2019-08-19T07:00:48Z")

</div>

> [@Ilyoskhuja](#):
>
> ```auto
> var createIndexResponse = client.Indices.Create("honadonz12", c => c
> .Map<ElasticSearchModel>(mm => mm
> .AutoMap()
> ) 
> .RequestConfiguration(r => r
> .DisableDirectStreaming()  
> ) 
> );
> 
> ```

I'd recommend also

1. checking to see if the index already exists _before_ trying to create it

2. checking that the index was successfully created, by looking at the `createIndexResponse`

---

<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:** [September 16, 2019, 7:00am UTC](https://discuss.elastic.co/t/cloud-elastic-account-reindex-docs/194177/10 "2019-09-16T07:00:57Z")

</div>

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