How to run example of context suggester in elasticsearch doc?


(yyh3011) #1

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

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Adrien Grand) #2

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 wrote:

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

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.comhttps://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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5vMNw7_Czzpe-UdfrH4hrDTYO%2ByFCj3guOha1OT9Q9SQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Cédric Warny) #3

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 <javascript:>> wrote:

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

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 <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d6a1b427-08ab-41a3-88f5-74d563bc6946%40googlegroups.comhttps://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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/cf1de8ad-4061-41bb-83a0-4b6390b99d49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4