Hi there,
I'm doing some tests with disabling source or not and storing fields or not.
I found that with 0.19.0.RC2, I can't get back the _source as a field, but
it was possible with 0.17.10 (and 0.18.7 I think).
Here is a full recreation :
Let me explain it here inline:
I created two types with same fields, but one with no source and fields
stored. The other one is standard, source enable.
Create the mapping using only fields
curl -XPOST http://localhost:9200/twitter/tweet/_mapping -d '{
"tweet" : {
"_source" : {"enabled" : false},
"properties" : {
"user" : {"type" : "string", "store" : "yes"},
"message" : {"type" : "string", "store" : "yes"}
}
}
}'
Create the mapping using source
curl -XPOST http://localhost:9200/twitter/othertweet/_mapping -d '{
"othertweet" : {
"properties" : {
"user" : {"type" : "string"},
"message" : {"type" : "string"}
}
}
}'
Then I index about the same document with these two types :
Indexing with fields
curl -XPUT http://localhost:9200/twitter/tweet/1 -d '{
"user" : "dadoonet field",
"message" : "Elasticsearch rocks field"
}'
Indexing with source
curl -XPUT http://localhost:9200/twitter/othertweet/1 -d '{
"user" : "dadoonet source",
"message" : "Elasticsearch rocks source"
}'
With 0.17.10 (and 0.18.x), I can get the _source as a field :
_source works with 0.17.10 but not with 0.19.0.RC2
curl -XPOST http://localhost:9200/_search?pretty=true -d '{
"fields" : ["_source"],
"query" : {
"match_all" : { }
}
}'
But it doesn't return _source field with 0.19.0.RC2. I can't find in the
release notes if it's a new feature or not.
So is it a bug ? I will open an issue if needed.
BTW, what I'm looking for is to be able to get "*" (all fields) AND
"_source" field in one single call.
But,
_source doesn't appear even with 0.17.10 nor 0.19.0.RC2
curl -XPOST http://localhost:9200/_search?pretty=true -d '{
"fields" : ["*", "_source"],
"query" : {
"match_all" : { }
}
}'
Doesn't send the _source field back.
May I open an issue for that also ?
Thanks for your help
David.