# Getting empty response from elastic search even though data is loaded to search server

**URL:** <https://discuss.elastic.co/t/getting-empty-response-from-elastic-search-even-though-data-is-loaded-to-search-server/21177>\
**Category:** Elasticsearch\
**Created:** [December 10, 2014, 4:37am UTC](https://discuss.elastic.co/t/getting-empty-response-from-elastic-search-even-though-data-is-loaded-to-search-server/21177 "2014-12-10T04:37:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijayakumari\_B\_N](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@Vijayakumari\_B\_N](https://discuss.elastic.co/u/Vijayakumari_B_N)\
**Post date:** [December 10, 2014, 4:37am UTC](https://discuss.elastic.co/t/getting-empty-response-from-elastic-search-even-though-data-is-loaded-to-search-server/21177/1 "2014-12-10T04:37:51Z")

</div>

Hi,

I am getting the empty response from elastic search server. Below is the  
POC which i had written.

For creating index i used

client.index(new IndexRequest("incident", "incident",  
(incident.getIrId()+"")).source(bytes)).actionGet();

i am able to see the below data loaded to elastic search server

index {[incident][incident][1],  
source[{"id":1,"optlock":0,"creationDate":1418116380611,"problem":null,"hidden":false,"irId":576956,"incidentDate":null,"description":null,"environment":"PRODUCTION","maxSeverity":"NONE","status":"REQUESTED","reviewedByServiceDelivery":false,"mgmtEmailSent":false,"draftEmailSent":false,"ownerGroup":null,"owner":null,"reportCount":0,"irLoggerGroup":null,"irLoggerName":null,"irOwnerGroup":null,"irOwnerName":null,"summary":"**Executive  
Summary:**   
  
**What happened?**  
  
  
**How was the incident identified?**  
  
  
**Who was impacted?**   
  
**For how  
long?**   
  
**How was Service restored?**  
  
  
**What is believed to have Caused the Incident?**  
  
  
","ihrFeedback":null,"pmrFeedback":null,"nonOperational":false,"symptom":"diwali","ifText":null,"thenText":null,"keywords":"new  
year","incidentIhrFeedback":null,"sii":0.0,"currentLogEntry":null,"ownerId":0,"detectionTime":0,"diagnosisTime":0,"totalIncidentTime":0,"detectionTimeSiv":0.0,"diagnosisTimeSiv":0.0,"recoveryTimeSiv":0.0,"affectedCustServices":[],"eventsIEC50IEC55":[],"eventsNotIEC50IEC55":[],"detectedByGroup":"-","detectionEvents":[],"diagnosedByGroup":"-","diagnosisEvents":[],"recoveredByGroup":"-","recoveryEvents":[],"ownerGroupId":0,"ownerGroupName":null,"ownerFullName":null,"recoveryTime":0,"serviceManagerOwnershipTime":-1,"serviceManagerOwnershipEvents":[],"eventsIEC50IEC55WithCiActivityOutcome":[],"shift":""}]}

index {[incident][incident][2],  
source[{"id":2,"optlock":0,"creationDate":1418116444243,"problem":null,"hidden":false,"irId":482550,"incidentDate":null,"description":null,"environment":"PRODUCTION","maxSeverity":"NONE","status":"REQUESTED","reviewedByServiceDelivery":false,"mgmtEmailSent":false,"draftEmailSent":false,"ownerGroup":null,"owner":null,"reportCount":0,"irLoggerGroup":null,"irLoggerName":null,"irOwnerGroup":null,"irOwnerName":null,"summary":"**Executive  
Summary:**   
  
**What happened?**  
  
  
**How was the incident identified?**  
  
  
**Who was impacted?**   
  
**For how  
long?**   
  
**How was Service restored?**  
  
  
**What is believed to have Caused the Incident?**  
  
  
","ihrFeedback":null,"pmrFeedback":null,"nonOperational":false,"symptom":null,"ifText":null,"thenText":null,"keywords":"new  
year  
2","incidentIhrFeedback":null,"sii":0.0,"currentLogEntry":null,"ownerId":0,"detectionTime":0,"diagnosisTime":0,"totalIncidentTime":0,"detectionTimeSiv":0.0,"diagnosisTimeSiv":0.0,"recoveryTimeSiv":0.0,"affectedCustServices":[],"eventsIEC50IEC55":[],"eventsNotIEC50IEC55":[],"detectedByGroup":"-","detectionEvents":[],"diagnosedByGroup":"-","diagnosisEvents":[],"recoveredByGroup":"-","recoveryEvents":[],"ownerGroupId":0,"ownerGroupName":null,"ownerFullName":null,"recoveryTime":0,"serviceManagerOwnershipTime":-1,"serviceManagerOwnershipEvents":[],"eventsIEC50IEC55WithCiActivityOutcome":[],"shift":""}]}

When i tried to search for text in indexed data with simple query string :

SearchResponse response = client.prepareSearch("incident")  
.setTypes("incident")  
.setQuery(query)  
.setFrom(from)  
.setSize(size)  
.execute().actionGet();

{  
"query" : {  
"simple\_query\_string" : {  
"query" : "new year",  
"fields" : ["symptomField", "keywordsField"]  
}  
}  
}

i get below response

{  
"took" : 1,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 0,  
"max\_score" : null,  
"hits" : []  
}  
}

Can someone please guide me where i am doing wrong, why elastic server is  
not able to fetch results.

Thanks in Advance,  
Vijaya

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [December 10, 2014, 10:33am UTC](https://discuss.elastic.co/t/getting-empty-response-from-elastic-search-even-though-data-is-loaded-to-search-server/21177/2 "2014-12-10T10:33:04Z")

</div>

Well. It seems that your documents don’t provide one of the two fields you are searching on.

BTW a full curl/SENSE recreation as a gist would be better to reproduce what you are doing. [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/) [http://www.elasticsearch.org/help/](http://www.elasticsearch.org/help/)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 10 déc. 2014 à 05:37, Vijayakumari B N [vijayakumari.bn@gmail.com](mailto:vijayakumari.bn@gmail.com) a écrit :
> 
> Hi,
> 
> I am getting the empty response from Elasticsearch server. Below is the POC which i had written.
> 
> For creating index i used
> 
> client.index(new IndexRequest("incident", "incident", (incident.getIrId()+"")).source(bytes)).actionGet();
> 
> i am able to see the below data loaded to Elasticsearch server
> 
> index {[incident][incident][1], source[{"id":1,"optlock":0,"creationDate":1418116380611,"problem":null,"hidden":false,"irId":576956,"incidentDate":null,"description":null,"environment":"PRODUCTION","maxSeverity":"NONE","status":"REQUESTED","reviewedByServiceDelivery":false,"mgmtEmailSent":false,"draftEmailSent":false,"ownerGroup":null,"owner":null,"reportCount":0,"irLoggerGroup":null,"irLoggerName":null,"irOwnerGroup":null,"irOwnerName":null,"summary":" **Executive Summary:**   
>   
> **What happened?**   
>   
> **How was the incident identified?**   
>   
> **Who was impacted?**   
>   
> **For how long?**   
>   
> **How was Service restored?**   
>   
> **What is believed to have Caused the Incident?**   
>   
> ","ihrFeedback":null,"pmrFeedback":null,"nonOperational":false,"symptom":"diwali","ifText":null,"thenText":null,"keywords":"new year","incidentIhrFeedback":null,"sii":0.0,"currentLogEntry":null,"ownerId":0,"detectionTime":0,"diagnosisTime":0,"totalIncidentTime":0,"detectionTimeSiv":0.0,"diagnosisTimeSiv":0.0,"recoveryTimeSiv":0.0,"affectedCustServices":,"eventsIEC50IEC55":,"eventsNotIEC50IEC55":,"detectedByGroup":"-","detectionEvents":,"diagnosedByGroup":"-","diagnosisEvents":,"recoveredByGroup":"-","recoveryEvents":,"ownerGroupId":0,"ownerGroupName":null,"ownerFullName":null,"recoveryTime":0,"serviceManagerOwnershipTime":-1,"serviceManagerOwnershipEvents":,"eventsIEC50IEC55WithCiActivityOutcome":,"shift":""}]}
> 
> index {[incident][incident][2], source[{"id":2,"optlock":0,"creationDate":1418116444243,"problem":null,"hidden":false,"irId":482550,"incidentDate":null,"description":null,"environment":"PRODUCTION","maxSeverity":"NONE","status":"REQUESTED","reviewedByServiceDelivery":false,"mgmtEmailSent":false,"draftEmailSent":false,"ownerGroup":null,"owner":null,"reportCount":0,"irLoggerGroup":null,"irLoggerName":null,"irOwnerGroup":null,"irOwnerName":null,"summary":" **Executive Summary:**   
>   
> **What happened?**   
>   
> **How was the incident identified?**   
>   
> **Who was impacted?**   
>   
> **For how long?**   
>   
> **How was Service restored?**   
>   
> **What is believed to have Caused the Incident?**   
>   
> ","ihrFeedback":null,"pmrFeedback":null,"nonOperational":false,"symptom":null,"ifText":null,"thenText":null,"keywords":"new year 2","incidentIhrFeedback":null,"sii":0.0,"currentLogEntry":null,"ownerId":0,"detectionTime":0,"diagnosisTime":0,"totalIncidentTime":0,"detectionTimeSiv":0.0,"diagnosisTimeSiv":0.0,"recoveryTimeSiv":0.0,"affectedCustServices":,"eventsIEC50IEC55":,"eventsNotIEC50IEC55":,"detectedByGroup":"-","detectionEvents":,"diagnosedByGroup":"-","diagnosisEvents":,"recoveredByGroup":"-","recoveryEvents":,"ownerGroupId":0,"ownerGroupName":null,"ownerFullName":null,"recoveryTime":0,"serviceManagerOwnershipTime":-1,"serviceManagerOwnershipEvents":,"eventsIEC50IEC55WithCiActivityOutcome":,"shift":""}]}
> 
> When i tried to search for text in indexed data with simple query string :
> 
> SearchResponse response = client.prepareSearch("incident")  
> .setTypes("incident")  
> .setQuery(query)  
> .setFrom(from)  
> .setSize(size)  
> .execute().actionGet();
> 
> {  
> "query" : {  
> "simple\_query\_string" : {  
> "query" : "new year",  
> "fields" : ["symptomField", "keywordsField"]  
> }  
> }  
> }
> 
> i get below response
> 
> {  
> "took" : 1,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 0,  
> "max\_score" : null,  
> "hits" :   
> }  
> }
> 
> Can someone please guide me where i am doing wrong, why elastic server is not able to fetch results.
> 
> Thanks in Advance,  
> Vijaya
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/07DAB446-095A-49E9-BD96-D0A368BD2533%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/07DAB446-095A-49E9-BD96-D0A368BD2533%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Vijayakumari\_B\_N](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@Vijayakumari\_B\_N](https://discuss.elastic.co/u/Vijayakumari_B_N)\
**Post date:** [December 11, 2014, 6:56am UTC](https://discuss.elastic.co/t/getting-empty-response-from-elastic-search-even-though-data-is-loaded-to-search-server/21177/3 "2014-12-11T06:56:08Z")

</div>

Thank you. I was searching for the fields which were not present in the  
document. Its my fault.

Thanks,  
Vijaya

On Wednesday, December 10, 2014 4:03:11 PM UTC+5:30, David Pilato wrote:

> Well. It seems that your documents don’t provide one of the two fields you  
> are searching on.
> 
> BTW a full curl/SENSE recreation as a gist would be better to reproduce  
> what you are doing. [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> [http://Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 10 déc. 2014 à 05:37, Vijayakumari B N \<[vijayak...@gmail.com](mailto:vijayak...@gmail.com)  
> \<javascript:\>\> a écrit :
> 
> Hi,
> 
> I am getting the empty response from Elasticsearch server. Below is the  
> POC which i had written.
> 
> For creating index i used
> 
> client.index(new IndexRequest("incident", "incident",  
> (incident.getIrId()+"")).source(bytes)).actionGet();
> 
> i am able to see the below data loaded to Elasticsearch server
> 
> index {[incident][incident][1],  
> source[{"id":1,"optlock":0,"creationDate":1418116380611,"problem":null,"hidden":false,"irId":576956,"incidentDate":null,"description":null,"environment":"PRODUCTION","maxSeverity":"NONE","status":"REQUESTED","reviewedByServiceDelivery":false,"mgmtEmailSent":false,"draftEmailSent":false,"ownerGroup":null,"owner":null,"reportCount":0,"irLoggerGroup":null,"irLoggerName":null,"irOwnerGroup":null,"irOwnerName":null,"summary":"**Executive  
> Summary:**   
>   
> **What happened?**  
>   
>   
> **How was the incident identified?**  
>   
>   
> **Who was impacted?**   
>   
> **For how  
> long?**   
>   
> **How was Service restored?**  
>   
>   
> **What is believed to have Caused the Incident?**  
>   
>   
> ","ihrFeedback":null,"pmrFeedback":null,"nonOperational":false,"symptom":"diwali","ifText":null,"thenText":null,"keywords":"new  
> year","incidentIhrFeedback":null,"sii":0.0,"currentLogEntry":null,"ownerId":0,"detectionTime":0,"diagnosisTime":0,"totalIncidentTime":0,"detectionTimeSiv":0.0,"diagnosisTimeSiv":0.0,"recoveryTimeSiv":0.0,"affectedCustServices":,"eventsIEC50IEC55":,"eventsNotIEC50IEC55":,"detectedByGroup":"-","detectionEvents":,"diagnosedByGroup":"-","diagnosisEvents":,"recoveredByGroup":"-","recoveryEvents":,"ownerGroupId":0,"ownerGroupName":null,"ownerFullName":null,"recoveryTime":0,"serviceManagerOwnershipTime":-1,"serviceManagerOwnershipEvents":,"eventsIEC50IEC55WithCiActivityOutcome":,"shift":""}]}
> 
> index {[incident][incident][2],  
> source[{"id":2,"optlock":0,"creationDate":1418116444243,"problem":null,"hidden":false,"irId":482550,"incidentDate":null,"description":null,"environment":"PRODUCTION","maxSeverity":"NONE","status":"REQUESTED","reviewedByServiceDelivery":false,"mgmtEmailSent":false,"draftEmailSent":false,"ownerGroup":null,"owner":null,"reportCount":0,"irLoggerGroup":null,"irLoggerName":null,"irOwnerGroup":null,"irOwnerName":null,"summary":"**Executive  
> Summary:**   
>   
> **What happened?**  
>   
>   
> **How was the incident identified?**  
>   
>   
> **Who was impacted?**   
>   
> **For how  
> long?**   
>   
> **How was Service restored?**  
>   
>   
> **What is believed to have Caused the Incident?**  
>   
>   
> ","ihrFeedback":null,"pmrFeedback":null,"nonOperational":false,"symptom":null,"ifText":null,"thenText":null,"keywords":"new  
> year  
> 2","incidentIhrFeedback":null,"sii":0.0,"currentLogEntry":null,"ownerId":0,"detectionTime":0,"diagnosisTime":0,"totalIncidentTime":0,"detectionTimeSiv":0.0,"diagnosisTimeSiv":0.0,"recoveryTimeSiv":0.0,"affectedCustServices":,"eventsIEC50IEC55":,"eventsNotIEC50IEC55":,"detectedByGroup":"-","detectionEvents":,"diagnosedByGroup":"-","diagnosisEvents":,"recoveredByGroup":"-","recoveryEvents":,"ownerGroupId":0,"ownerGroupName":null,"ownerFullName":null,"recoveryTime":0,"serviceManagerOwnershipTime":-1,"serviceManagerOwnershipEvents":,"eventsIEC50IEC55WithCiActivityOutcome":,"shift":""}]}
> 
> When i tried to search for text in indexed data with simple query string :
> 
> SearchResponse response = client.prepareSearch("incident")  
> .setTypes("incident")  
> .setQuery(query)  
> .setFrom(from)  
> .setSize(size)  
> .execute().actionGet();
> 
> {  
> "query" : {  
> "simple\_query\_string" : {  
> "query" : "new year",  
> "fields" : ["symptomField", "keywordsField"]  
> }  
> }  
> }
> 
> i get below response
> 
> {  
> "took" : 1,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 0,  
> "max\_score" : null,  
> "hits" :   
> }  
> }
> 
> Can someone please guide me where i am doing wrong, why elastic server is  
> not able to fetch results.
> 
> Thanks in Advance,  
> Vijaya
> 
> --  
> 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](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5038a985-8aa2-43af-b9ab-ae64b2e75f44%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ba8bc30a-c2b4-4bee-b0c1-6cf56f9337d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ba8bc30a-c2b4-4bee-b0c1-6cf56f9337d1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:44am UTC](https://discuss.elastic.co/t/getting-empty-response-from-elastic-search-even-though-data-is-loaded-to-search-server/21177/4 "2017-07-06T00:44:17Z")

</div>


