Created
November 15, 2012 07:56
-
-
Save radu-gheorghe/4077293 to your computer and use it in GitHub Desktop.
Elasticsearch terms facet string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -XPOST localhost:9200/test/test/ -d '{"timestamp": "random_date", "tag":"blue", "counter": "5"}' | |
{"ok":true,"_index":"test","_type":"test","_id":"qVmyc9otSqWqUOKWoteM5Q","_version":1} | |
$ curl -XGET localhost:9200/test/test/_mapping?pretty=true | |
{ | |
"test" : { | |
"properties" : { | |
"counter" : { | |
"type" : "string" | |
}, | |
"tag" : { | |
"type" : "string" | |
}, | |
"timestamp" : { | |
"type" : "string" | |
} | |
} | |
} | |
} | |
$ curl -XPOST localhost:9200/test/test/_search?pretty=true -d '{ | |
> "query": { | |
> "match_all": {} | |
> }, | |
> "facets" : { | |
> "test_facet" : { | |
> "terms_stats" : { | |
> "key_field" : "tag", | |
> "value_field" : "counter" | |
> } | |
> } | |
> } | |
> }' | |
{ | |
"error" : "SearchPhaseExecutionException[Failed to execute phase [query_fetch], total failure; shardFailures {[tbpy27tVRIeA5qjVsI-a4Q][test][0]: QueryPhaseExecutionException[[test][0]: query[ConstantScore(NotDeleted(cache(_type:test)))],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: ClassCastException[org.elasticsearch.index.field.data.strings.SingleValueStringFieldData cannot be cast to org.elasticsearch.index.field.data.NumericFieldData]; }]", | |
"status" : 500 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment