Created
February 8, 2011 15:24
-
-
Save buggyvelarde/816572 to your computer and use it in GitHub Desktop.
how to retrieve specific _source inner fields
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 -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