# {"error":{"root\_cause":\[{"type":"parsing\_exception","reason":"Unknown key for a START\_OBJECT in \[try\].","line":1,"col":8}\],"type":"parsing\_exception","reason":"Unknown key for a START\_OBJECT in \[try\].","line":1,"col":8},"status":400}

**URL:** <https://discuss.elastic.co/t/error-root-cause-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-status-400/162417>\
**Category:** Elasticsearch\
**Created:** [December 29, 2018, 2:24pm UTC](https://discuss.elastic.co/t/error-root-cause-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-status-400/162417 "2018-12-29T14:24:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsuchi](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lsuchi](https://discuss.elastic.co/u/lsuchi)\
**Post date:** [December 29, 2018, 2:24pm UTC](https://discuss.elastic.co/t/error-root-cause-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-status-400/162417/1 "2018-12-29T14:24:14Z")

</div>

```
<?php

namespace App\Http\Controllers;

use Elasticsearch\Client;
use Illuminate\Http\Request;

class AjaxController extends Controller
{
public function getPage()
	{
		return view('suggest');
}

private $client;

public function __construct(Client $client)
{
$this->client = $client;
}

public function suggest(Request $request)
{
$data = $request->all();

$params = [
    'index' => 'blueocean',
    'body' => [
        'try' => [
            'text' => 'god',
            'completion' => ['field' => 'Provider']
        ]
    ]
];

dump($data);

$response = $this->client->search($params);
dump($response);
}

}

```

I'm getting {"error":{"root\_cause":[{"type":"parsing\_exception","reason":"Unknown key for a START\_OBJECT in [try].","line":1,"col":8}],"type":"parsing\_exception","reason":"Unknown key for a START\_OBJECT in [try].","line":1,"col":8},"status":400} error.  
Why?  
Any help?

---

<div class="post-metadata">

**Author:** ![sebidchi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebidchi/32/39248_2.png) [@sebidchi](https://discuss.elastic.co/u/sebidchi)\
**Post date:** [December 29, 2018, 4:38pm UTC](https://discuss.elastic.co/t/error-root-cause-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-status-400/162417/2 "2018-12-29T16:38:07Z")

</div>

Hello,

At first sight looks like you query is invalid:

I don't think `try` is a valid key (is what the error log is telling you) and the rest of que query does also not look good to me . What are you trying to get ? How your mapping is ?

---

<div class="post-metadata">

**Author:** ![lsuchi](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lsuchi](https://discuss.elastic.co/u/lsuchi)\
**Post date:** [December 31, 2018, 6:40am UTC](https://discuss.elastic.co/t/error-root-cause-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-status-400/162417/4 "2018-12-31T06:40:53Z")

</div>

Thanks for reply sir.  
I'm going to implement autocomplete feature with this with no success. If possible, tell me what I'm doing wrong.

Mapping:

```auto
    curl -X PUT "localhost:9200/hosting" -H 'Content-Type: application/json' -d'
    {
        "settings": {
            "number_of_shards": 1, 
            "analysis": {
                "filter": {
                    "autocomplete_filter": { 
                        "type": "edge_ngram",
                        "min_gram": 1,
                        "max_gram": 20
                    }
                },
                "analyzer": {
                    "autocomplete": {
                        "type": "custom",
                        "tokenizer": "standard",
                        "filter": [
                            "lowercase",
                            "autocomplete_filter" 
                        ]
                    }
                }
            }
        },

    "mappings" : 
    {
        "plans" : 
        {
            "properties" : 
            {
            	"Provider":
            	{
            		"type": "text",
					"analyzer" : "standard"
            	},

            	"Name":
            	{
            		"type": "text",
					"analyzer" : "standard"
            	},

            	"UpdatedAt":
            	{
            		"type": "text",
					"analyzer" : "standard"
            	}
            }
        }
    }
}

```

---

<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 28, 2019, 6:41am UTC](https://discuss.elastic.co/t/error-root-cause-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-type-parsing-exception-reason-unknown-key-for-a-start-object-in-try-line-1-col-8-status-400/162417/5 "2019-01-28T06:41:02Z")

</div>

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