Hi,
I have following type mapping
XContentBuilder builder = XContentFactory.jsonBuilder();
builder.startObject().
startObject("optimizedmetric1").
startObject("_all").field("enabled", false).endObject().
startObject("_source").field("enabled", false).endObject().
startObject("_index").field("enabled", false).endObject().
startObject("properties").
startObject("object").
field("type", "string").
field("store", "yes").
field("index", "not_analyzed").
field("omit_norms", true).
endObject().
startObject("metric").
field("type", "string").
field("store", "yes").
field("index", "not_analyzed").
field("omit_norms", true).
endObject().
startObject("value").
field("type", "double").
field("store", "yes").
field("index", "not_analyzed").
field("omit_norms", true).
endObject().
startObject("timestamp").
field("type", "long").
field("store", "yes").
field("index", "not_analyzed").
field("omit_norms", true).
endObject().
startObject("standartdev").
field("type", "double").
field("store", "yes").
field("index", "not_analyzed").
field("omit_norms", true).
endObject().
endObject().
endObject().
endObject();
After inserting some documents, I tried to search and get fields of inserted
objects using following CURL request*
curl -XGET 'http://host:port/performance/optimizedmetric1/_search' -d '
{
"fields" : ["object"],
"query" : {
"match_all":{}
}
}'
It returns following result:
{"took":0,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":10000,"max_score":1.0,"hits":[{"_index":"performance","_type":"optimizedmetric1","_id":"grfsll6yruqlxkojlydjrg","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"p11wzy33teq9h6zcmbooka","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"vfjf8he-soqnvxemmkgira","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"p1wda31dtqyjgbagscxilw","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"oyahsw7cs4iuf2efcp_g6g","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"db0y-k0yqg6qntbfrt1qvg","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"-i5vmsptrfsze81stswoxq","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"1ciy9u95tzetb9snee-_ya","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"rwrkklo2syofeuvhwmy0lg","_score":1.0},{"_index":"performance","_type":"optimizedmetric1","_id":"s8amnskbrzkkk8oxgyv38g","_score":1.0}]}}
I expected to see object field but results does not include it. is this
normal?
--
Mustafa Sener
www.ifountain.com