Skip to content

Instantly share code, notes, and snippets.

@buggyvelarde
Created February 8, 2011 15:24
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 buggyvelarde/816572 to your computer and use it in GitHub Desktop.
Save buggyvelarde/816572 to your computer and use it in GitHub Desktop.
how to retrieve specific _source inner fields
$ curl -XPUT 'http://localhost:9200/features/Feature/Pfalciparum_REP_45?pretty=true' -d'{
"uniqueName":"Pfalciparum_REP_45",
"coordinates":[{"region":"Pf3D7_01","fmin":641897,"fmax":642097,"phase":null,"strand":0}]
}'
{
"ok" : true,
"_index" : "features",
"_type" : "Feature",
"_id" : "Pfalciparum_REP_45",
"_version" : 1
}
$ curl -XGET 'http://localhost:9200/features/Feature/Pfalciparum_REP_45?pretty=true'
{
"_index" : "features",
"_type" : "Feature",
"_id" : "Pfalciparum_REP_45"
}
$ curl -XGET 'http://localhost:9200/features/Feature/Pfalciparum_REP_45?pretty=true&refresh=true&fields=_source'
{
"_index" : "features",
"_type" : "Feature",
"_id" : "Pfalciparum_REP_45",
"_version" : 1, "_source" : {
"uniqueName":"Pfalciparum_REP_45",
"coordinates":[{"region":"Pf3D7_01","fmin":641897,"fmax":642097,"phase":null,"strand":0}]
}
}
$ curl -XGET 'http://localhost:9200/features/Feature/Pfalciparum_REP_45?pretty=true&refresh=true&fields=_source.coordinates'
{
"error" : "ElasticSearchException[No mapping for field [_source.coordinates] in type [Feature]]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment