# How to run example of context suggester in elasticsearch doc?

**URL:** <https://discuss.elastic.co/t/how-to-run-example-of-context-suggester-in-elasticsearch-doc/17017>\
**Category:** Elasticsearch\
**Created:** [April 15, 2014, 6:14am UTC](https://discuss.elastic.co/t/how-to-run-example-of-context-suggester-in-elasticsearch-doc/17017 "2014-04-15T06:14:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yyh3011](https://avatars.discourse-cdn.com/v4/letter/y/6de8d8/32.png) [@yyh3011](https://discuss.elastic.co/u/yyh3011)\
**Post date:** [April 15, 2014, 6:14am UTC](https://discuss.elastic.co/t/how-to-run-example-of-context-suggester-in-elasticsearch-doc/17017/1 "2014-04-15T06:14:04Z")

</div>

I am learning the elasticsearch, and I want to run the example of context  
suggester following the  
doc: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html)

But I always get the error when I create the mapping,

error: {"error":"MapperParsingException[Unknown field  
[context]]","status":400}

my dsl:  
curl -X PUT localhost:9200/sale  
curl -X PUT "localhost:9200/sale/product/\_mapping" -d '  
{  
"product": {  
"properties": {  
"name": {  
"type" : "string"  
},  
"tag": {  
"type" : "string"  
},"colorField": {"type":"string" },  
"suggest": {  
"type": "completion",  
"context": {  
"color": {  
"type": "category",  
"path": "colorField",  
"default": ["red", "green", "blue"]  
},  
"location": {  
"type": "geo",  
"precision": "5m",  
"neighbors": true,  
"default": "u33"  
}  
}  
}  
}  
}  
}'

does any one know the reason?

thanks  
Johnson

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [April 15, 2014, 10:40am UTC](https://discuss.elastic.co/t/how-to-run-example-of-context-suggester-in-elasticsearch-doc/17017/2 "2014-04-15T10:40:36Z")

</div>

Hi,

The context suggester will be available in Elasticsearch 1.2.0, it has not  
been released yet. (see note at the top of the documentation)

On Tue, Apr 15, 2014 at 8:14 AM, [yyh3011@gmail.com](mailto:yyh3011@gmail.com) wrote:

> I am learning the elasticsearch, and I want to run the example of context  
> suggester following the doc:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html)
> 
> But I always get the error when I create the mapping,
> 
> error: {"error":"MapperParsingException[Unknown field  
> [context]]","status":400}
> 
> my dsl:  
> curl -X PUT localhost:9200/sale  
> curl -X PUT "localhost:9200/sale/product/\_mapping" -d '  
> {  
> "product": {  
> "properties": {  
> "name": {  
> "type" : "string"  
> },  
> "tag": {  
> "type" : "string"  
> },"colorField": {"type":"string" },  
> "suggest": {  
> "type": "completion",  
> "context": {  
> "color": {  
> "type": "category",  
> "path": "colorField",  
> "default": ["red", "green", "blue"]  
> },  
> "location": {  
> "type": "geo",  
> "precision": "5m",  
> "neighbors": true,  
> "default": "u33"  
> }  
> }  
> }  
> }  
> }  
> }'
> 
> does any one know the reason?
> 
> thanks  
> Johnson
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5vMNw7\_Czzpe-UdfrH4hrDTYO%2ByFCj3guOha1OT9Q9SQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5vMNw7_Czzpe-UdfrH4hrDTYO%2ByFCj3guOha1OT9Q9SQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Cedric\_Warny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cedric_warny/32/1523_2.png) [@Cedric\_Warny](https://discuss.elastic.co/u/Cedric_Warny)\
**Post date:** [May 29, 2014, 5:16pm UTC](https://discuss.elastic.co/t/how-to-run-example-of-context-suggester-in-elasticsearch-doc/17017/3 "2014-05-29T17:16:41Z")

</div>

I downloaded Elasticsearch 1.2.0 and have Java 1.7.0\_25. I still get the  
same error as Johnson. Is it because of the Java version or is it because I  
still have Elasticsearch 1.1.1 in another folder or is it for some other  
reason?  
Thanks in advance for your help.

Cedric

Le mardi 15 avril 2014 06:40:36 UTC-4, Adrien Grand a écrit :

> Hi,
> 
> The context suggester will be available in Elasticsearch 1.2.0, it has not  
> been released yet. (see note at the top of the documentation)
> 
> On Tue, Apr 15, 2014 at 8:14 AM, \<[yyh...@gmail.com](mailto:yyh...@gmail.com) \<javascript:\>\> wrote:
> 
> > I am learning the elasticsearch, and I want to run the example of context  
> > suggester following the doc:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html)
> > 
> > But I always get the error when I create the mapping,
> > 
> > error: {"error":"MapperParsingException[Unknown field  
> > [context]]","status":400}
> > 
> > my dsl:  
> > curl -X PUT localhost:9200/sale  
> > curl -X PUT "localhost:9200/sale/product/\_mapping" -d '  
> > {  
> > "product": {  
> > "properties": {  
> > "name": {  
> > "type" : "string"  
> > },  
> > "tag": {  
> > "type" : "string"  
> > },"colorField": {"type":"string" },  
> > "suggest": {  
> > "type": "completion",  
> > "context": {  
> > "color": {  
> > "type": "category",  
> > "path": "colorField",  
> > "default": ["red", "green", "blue"]  
> > },  
> > "location": {  
> > "type": "geo",  
> > "precision": "5m",  
> > "neighbors": true,  
> > "default": "u33"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > does any one know the reason?
> > 
> > thanks  
> > Johnson
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cf1de8ad-4061-41bb-83a0-4b6390b99d49%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cf1de8ad-4061-41bb-83a0-4b6390b99d49%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:26am UTC](https://discuss.elastic.co/t/how-to-run-example-of-context-suggester-in-elasticsearch-doc/17017/4 "2017-07-06T01:26:05Z")

</div>


