Throws java.lang.NullPointerException when getSource

Hi there,

When I was running a piece of code, which means to get some doc from my
index, it throws the exception java.lang.NullPointerException。
Is there anything I set wrongly? Thanks.

My code is like this:
GetResponse response = client.prepareGet(indexName, "kba", stream_id)
.execute()
.actionGet();
String body_cleansed = response.getSource().get("body_cleansed").toString();

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Did you disable source in mapping?

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 avr. 2013 à 18:27, Jingang Wang bitwjg@gmail.com a écrit :

Hi there,

When I was running a piece of code, which means to get some doc from my index, it throws the exception java.lang.NullPointerException。
Is there anything I set wrongly? Thanks.

My code is like this:
GetResponse response = client.prepareGet(indexName, "kba", stream_id)
.execute()
.actionGet();
String body_cleansed = response.getSource().get("body_cleansed").toString();

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David,
I don't think so. I preserved the source option when I was creating the
indices.
I remembered that I could run this program the other days.
Is there other reasons could result in this situation?

On Friday, April 19, 2013 12:29:35 AM UTC+8, David Pilato wrote:

Did you disable source in mapping?

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 18 avr. 2013 à 18:27, Jingang Wang <bit...@gmail.com <javascript:>> a
écrit :

Hi there,

When I was running a piece of code, which means to get some doc from my
index, it throws the exception java.lang.NullPointerException。
Is there anything I set wrongly? Thanks.

My code is like this:
GetResponse response = client.prepareGet(indexName, "kba", stream_id)
.execute()
.actionGet();
String body_cleansed = response.getSource()
.get("body_cleansed").toString();

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I have checked it.
When I use prepareSearch, getSource works fine.
While when I use prepareGet, getSource throws this exception.

On Friday, April 19, 2013 12:29:35 AM UTC+8, David Pilato wrote:

Did you disable source in mapping?

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 18 avr. 2013 à 18:27, Jingang Wang <bit...@gmail.com <javascript:>> a
écrit :

Hi there,

When I was running a piece of code, which means to get some doc from my
index, it throws the exception java.lang.NullPointerException。
Is there anything I set wrongly? Thanks.

My code is like this:
GetResponse response = client.prepareGet(indexName, "kba", stream_id)
.execute()
.actionGet();
String body_cleansed = response.getSource()
.get("body_cleansed").toString();

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.