Skip to content

Instantly share code, notes, and snippets.

@imotov
Created November 21, 2012 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imotov/4122515 to your computer and use it in GitHub Desktop.
Save imotov/4122515 to your computer and use it in GitHub Desktop.
curl -XDELETE localhost:9200/test-idx
echo
curl -XPUT localhost:9200/test-idx -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
"mappings": {
"doc": {
"properties": {
"name": {
"type": "string"
}
}
}
}
}
'
echo
curl -XPUT localhost:9200/test-idx/doc/1 -d '{"name":"foo"}'
echo
curl -XPUT localhost:9200/test-idx/doc/2 -d '{"name":"bar"}'
echo
curl -XPUT localhost:9200/test-idx/doc/3 -d '{"name":"baz"}'
echo
curl -XPOST localhost:9200/test-idx/_refresh
echo
curl localhost:9200/test-idx/doc/_search -d '{
"query": {
"custom_score": {
"query": {
"match_all": {}
},
"script": "Float.NaN"
}
}
}
'
# Returns:
# {"error":"SearchPhaseExecutionException[Failed to execute phase [query_fetch], total failure; shardFailures {IllegalArgumentException[docID must be >= 0 and < maxDoc=3 (got docID=2147483647)]}]","status":500}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment