# Differences with field \_source between 0.17.10 and 0.19.0.RC2

**URL:** <https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762>\
**Category:** Elasticsearch\
**Created:** [February 20, 2012, 11:29pm UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762 "2012-02-20T23:29:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 20, 2012, 11:29pm UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/1 "2012-02-20T23:29:08Z")

</div>

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 :

> <https://gist.github.com/dadoonet/1872218>

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](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](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](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](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](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](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.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 21, 2012, 9:54am UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/2 "2012-02-21T09:54:04Z")

</div>

Hi David

> 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).

This is probably related to issue 1705, which has been fixed in  
0.19.0RC3: [\_source field not being returned when a script field is specified · Issue #1705 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1705)

The queries in your gist all seem to work in master

clint

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 21, 2012, 6:02pm UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/3 "2012-02-21T18:02:25Z")

</div>

Thanks Clint.

I did not find myself this issue... Thanks for the link.

BTW, there was another question. I'm trying 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](http://localhost:9200/_search?pretty) [http://localhost:9200/\_search?pretty](http://localhost:9200/_search?pretty)

true -d '{

```
"fields" : ["*", "_source"],

"query" : {

  "match_all" : { }

```

}

}'

Doesn’t send the \_source field back. If I ask for a specific field and  
\_source, it works fine. So I imagine that if \* takes precedence of any  
other field (including \_source)

May I open an issue for that ?

Thanks,  
David.

Le 21 février 2012 à 10:54, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) a écrit  
:

> Hi David
> 
> > 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).
> 
> This is probably related to issue 1705, which has been fixed in  
> 0.19.0RC3: [\_source field not being returned when a script field is specified · Issue #1705 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1705)
> 
> The queries in your gist all seem to work in master
> 
> clint

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![mattweber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattweber/32/44940_2.png) [@mattweber](https://discuss.elastic.co/u/mattweber)\
**Post date:** [February 21, 2012, 8:26pm UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/4 "2012-02-21T20:26:43Z")

</div>

David,

Did you see this?

> <https://github.com/elastic/elasticsearch/issues/1541>
>
> The source field is not returned in a query where \\\* is specified and source is …explicitly asked for.
> 
> Works as expected, returns the name and source
> 
> \<pre\>
> curl -XGET 'http://localhost:9200/testindex/testtype/\_search?q=lucene+in+action&pretty=true' -d '{"fields":\["name","\_source"\]}'
> \</pre\>
> 
> 
> Does not work, returns only the stored fields, no source.
> 
> \<pre\>
> curl -XGET 'http://localhost:9200/testindex/testtype/\_search?q=lucene+in+action&pretty=true' -d '{"fields":\["\*","\_source"\]}'
> \</pre\>
> 
> 
> Happens using both DSL and URI Request fields parameter.

I was trying to do the same thing a while ago and opened an issue. This fix should be in the 0.19.0 RC's, but I have not checked that it actually works.

--  
Matt Weber  
Sent with Sparrow ([http://www.sparrowmailapp.com/?sig](http://www.sparrowmailapp.com/?sig))

On Tuesday, February 21, 2012 at 10:02 AM, [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Thanks Clint.
> 
> I did not find myself this issue... Thanks for the link.
> 
> BTW, there was another question. I'm trying 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](http://localhost:9200/_search?pretty) = true -d '{  
> "fields" : ["\*", "\_source"],  
> "query" : {  
> "match\_all" : { }  
> }  
> }'
> 
> Doesn’t send the \_source field back. If I ask for a specific field and \_source, it works fine. So I imagine that if \* takes precedence of any other field (including \_source)
> 
> May I open an issue for that ?
> 
> Thanks,
> 
> David.
> 
> Le 21 février 2012 à 10:54, Clinton Gormley \<[clint@traveljury.com](mailto:clint@traveljury.com) ([mailto:clint@traveljury.com](mailto:clint@traveljury.com))\> a écrit :
> 
> > Hi David
> > 
> > > 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).
> > 
> > This is probably related to issue 1705, which has been fixed in  
> > 0.19.0RC3: [\_source field not being returned when a script field is specified · Issue #1705 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1705)
> > 
> > The queries in your gist all seem to work in master
> > 
> > clint
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 21, 2012, 8:41pm UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/5 "2012-02-21T20:41:36Z")

</div>

Thanks Matt,

Exactly what I'm looking for !

As far as I remember my test yesterday (in France, we said that I have the same memory as a golden fish 😉 ), it was not working in 0.19.0.RC2 but it should work as Shay closed this issue two months ago.

I will make more tests with the RC3 tomorrow and comment the issue if needed.

Thanks again  
David 😉  
@dadoonet

Le 21 févr. 2012 à 21:26, Matt Weber [matt@mattweber.org](mailto:matt@mattweber.org) a écrit :

> David,
> 
> Did you see this?
> 
> [source not returned when \* specified in fields list · Issue #1541 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1541)
> 
> I was trying to do the same thing a while ago and opened an issue. This fix should be in the 0.19.0 RC's, but I have not checked that it actually works.
> 
> --  
> Matt Weber  
> Sent with Sparrow
> 
> On Tuesday, February 21, 2012 at 10:02 AM, [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Thanks Clint.
> > 
> > I did not find myself this issue... Thanks for the link.
> > 
> > BTW, there was another question. I'm trying 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](http://localhost:9200/_search?pretty)
> > 
> > true -d '{
> > 
> > ```
> > "fields" : ["*", "_source"],
> > "query" : {
> > "match_all" : { }
> > 
> > ```
> > 
> > }  
> > }'
> > 
> > Doesn’t send the \_source field back. If I ask for a specific field and \_source, it works fine. So I imagine that if \* takes precedence of any other field (including \_source)
> > 
> > May I open an issue for that ?
> > 
> > Thanks,  
> > David.
> > 
> > Le 21 février 2012 à 10:54, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) a écrit :
> > 
> > > Hi David
> > > 
> > > > 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).
> > > 
> > > This is probably related to issue 1705, which has been fixed in  
> > > 0.19.0RC3: [\_source field not being returned when a script field is specified · Issue #1705 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1705)
> > > 
> > > The queries in your gist all seem to work in master
> > > 
> > > clint
> > 
> > --  
> > David Pilato  
> > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 22, 2012, 8:18pm UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/6 "2012-02-22T20:18:56Z")

</div>

Matt,

It’s working fine in 0.19.x !

Thanks for your help

David.

De : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)] De la part de David Pilato  
Envoyé : mardi 21 février 2012 21:42  
À : [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Objet : Re: Differences with field \_source between 0.17.10 and 0.19.0.RC2

Thanks Matt,

Exactly what I'm looking for !

As far as I remember my test yesterday (in France, we said that I have the same memory as a golden fish 😉 ), it was not working in 0.19.0.RC2 but it should work as Shay closed this issue two months ago.

I will make more tests with the RC3 tomorrow and comment the issue if needed.

Thanks again  
David 😉

@dadoonet

Le 21 févr. 2012 à 21:26, Matt Weber [matt@mattweber.org](mailto:matt@mattweber.org) a écrit :

David,

Did you see this?

[https://github.com/elasticsearch/elasticsearch/issues/1541](https://github.com/elasticsearch/elasticsearch/issues/1541)

I was trying to do the same thing a while ago and opened an issue. This fix should be in the 0.19.0 RC's, but I have not checked that it actually works.

--

Matt Weber

Sent with Sparrow [http://www.sparrowmailapp.com/?sig](http://www.sparrowmailapp.com/?sig)

On Tuesday, February 21, 2012 at 10:02 AM, [david@pilato.fr](mailto:david@pilato.fr) wrote:

Thanks Clint.

I did not find myself this issue... Thanks for the link.

BTW, there was another question. I'm trying 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](http://localhost:9200/_search?pretty)

true -d '{

```
"fields" : ["*", "_source"],
"query" : {
  "match_all" : { }

```

}  
}'

Doesn’t send the \_source field back. If I ask for a specific field and \_source, it works fine. So I imagine that if \* takes precedence of any other field (including \_source)

May I open an issue for that ?

Thanks,

David.

Le 21 février 2012 à 10:54, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) a écrit :

> Hi David
> 
> > 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).
> 
> This is probably related to issue 1705, which has been fixed in  
> 0.19.0RC3: [\_source field not being returned when a script field is specified · Issue #1705 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1705)
> 
> The queries in your gist all seem to work in master
> 
> clint

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:38am UTC](https://discuss.elastic.co/t/differences-with-field--source-between-0-17-10-and-0-19-0-rc2/6762/7 "2017-07-06T03:38:31Z")

</div>


