Skip to content

Instantly share code, notes, and snippets.

@enguzekli
Created January 17, 2012 14:29
Show Gist options
  • Save enguzekli/1626815 to your computer and use it in GitHub Desktop.
Save enguzekli/1626815 to your computer and use it in GitHub Desktop.
$ curl -XPUT 'http://localhost:9200/index1/type1/1' -d '{
"type1" : {
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}
}'
--------------------------Search with an invalid query-----------------------------------
$ curl -XGET 'http://localhost:9200/index1/type1/_search?q=*:
--------------------------Search with a valid query-----------------------------------
$ curl -XGET 'http://localhost:9200/index1/type1/_search?q=*:*
RESPONSE:
{
"took": 31,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0,
"failures": [
{
"index": "index1",
"shard": 4,
"status": 400,
"reason": "SearchParseException[[index1][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [:)\n\u0005򄱵ery򋱵ery_string򀁪:—lowercase_expanded_terms#analyze_wildcard\"󻻀]]]; nested: QueryParsingException[[index1] Failed to parse query [*:]]; nested: ParseException[Cannot parse '*:': Encountered \"<EOF>\" at line 1, column 2.\r\nWas expecting one of:\r\n \"(\" ...\r\n \"*\" ...\r\n <QUOTED> ...\r\n <TERM> ...\r\n <PREFIXTERM> ...\r\n <WILDTERM> ...\r\n \"[\" ...\r\n \"{\" ...\r\n <NUMBER> ...\r\n ]; nested: ParseException[Encountered \"<EOF>\" at line 1, column 2.\r\nWas expecting one of:\r\n \"(\" ...\r\n \"*\" ...\r\n <QUOTED> ...\r\n <TERM> ...\r\n <PREFIXTERM> ...\r\n <WILDTERM> ...\r\n \"[\" ...\r\n \"{\" ...\r\n <NUMBER> ...\r\n ]; "
}
]
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "index1",
"_type": "type1",
"_id": "uZJU4MzSRH2hBE_fqFZANA",
"_score": 1,
"_source": {
"type1": {
"user": "kimchy",
"post_date": "2009-11-15T14:12:12",
"message": "trying out Elastic Search"
}
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment