# No hits if fields are not stored

**URL:** <https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342>\
**Category:** Elasticsearch\
**Created:** [April 21, 2015, 10:50am UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342 "2015-04-21T10:50:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![redserpent7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redserpent7/32/467_2.png) [@redserpent7](https://discuss.elastic.co/u/redserpent7)\
**Post date:** [April 21, 2015, 10:50am UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/1 "2015-04-21T10:50:58Z")

</div>

Hi,

I am having issues with ES. I have configured ES to store the \_source  
field, however when I query I do not get any hits unless I "store" the  
fields that I want to query. This is how my query request looks like:

{  
"from": 0,  
"size": 50,  
"sort": [  
{  
"_score": {  
"order": "desc"  
}  
}  
],  
"fields": [  
"filename",  
"filesize"  
],  
"aggs": {  
"extension": {  
"terms": {  
"field": "extension"  
}  
},  
"pagecount": {  
"terms": {  
"field": "pagecount"  
}  
},  
"dates": {  
"date\_range": {  
"field": "modificationdate",  
"format": "MM-yyyy",  
"ranges": [  
{  
"from": "now-1M/M",  
"to": "now",  
"key": "one\_month"  
},  
{  
"from": "now-3M/M",  
"to": "now-1M/M",  
"key": "three\_months"  
},  
{  
"from": "0",  
"to": "now-3M/M",  
"key": "old"  
}  
]  
}  
}  
},  
"query": {  
"multi\_match": {  
"query": "some string",  
"fields": [  
"filename^3",  
"content_\*^2",  
"content\_ukw"  
]  
}  
}  
}

Unfortunately without storing the filename and the content\_ fileds, I do  
not get any results and ES returns no hits.

--  
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/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%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:** [April 21, 2015, 10:59am UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/2 "2015-04-21T10:59:13Z")

</div>

I don’t understand. Could you GIST a full recreation scripts which demonstrate what you are seeing?

--  
David Pilato - Developer | Evangelist

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co/)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

@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 21 avr. 2015 à 12:50, Zaid Amir [redserpent7@gmail.com](mailto:redserpent7@gmail.com) a écrit :
> 
> Hi,
> 
> I am having issues with ES. I have configured ES to store the \_source field, however when I query I do not get any hits unless I "store" the fields that I want to query. This is how my query request looks like:
> 
> {  
> "from": 0,  
> "size": 50,  
> "sort": [  
> {  
> "_score": {  
> "order": "desc"  
> }  
> }  
> ],  
> "fields": [  
> "filename",  
> "filesize"  
> ],  
> "aggs": {  
> "extension": {  
> "terms": {  
> "field": "extension"  
> }  
> },  
> "pagecount": {  
> "terms": {  
> "field": "pagecount"  
> }  
> },  
> "dates": {  
> "date\_range": {  
> "field": "modificationdate",  
> "format": "MM-yyyy",  
> "ranges": [  
> {  
> "from": "now-1M/M",  
> "to": "now",  
> "key": "one\_month"  
> },  
> {  
> "from": "now-3M/M",  
> "to": "now-1M/M",  
> "key": "three\_months"  
> },  
> {  
> "from": "0",  
> "to": "now-3M/M",  
> "key": "old"  
> }  
> ]  
> }  
> }  
> },  
> "query": {  
> "multi\_match": {  
> "query": "some string",  
> "fields": [  
> "filename^3",  
> "content_\*^2",  
> "content\_ukw"  
> ]  
> }  
> }  
> }
> 
> Unfortunately without storing the filename and the content\_ fileds, I do not get any results and ES returns no hits.
> 
> --  
> 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/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%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/2B522B56-1928-48E2-89BA-15792D5E1B33%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/2B522B56-1928-48E2-89BA-15792D5E1B33%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![redserpent7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redserpent7/32/467_2.png) [@redserpent7](https://discuss.elastic.co/u/redserpent7)\
**Post date:** [April 21, 2015, 11:54am UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/3 "2015-04-21T11:54:56Z")

</div>

Sorry, not sure what you mean by a recreation script. But here is how my  
index is created and mapped along with the search query

#Create an Index  
curl -XPUT 'localhost:9200/files

#Create index mapping enabling \_source and disabling \_all fields  
#Without the store property set to true, no results are returned

curl -XPUT /files/rawfiles/\_mapping -d '{  
"rawfiles": {  
"\_source": {  
"enabled": true  
},  
"\_all": {  
"enabled": false  
},  
"\_timestamp": {  
"enabled": true,  
"path": "timestamp"  
},  
"properties": {  
"fileid": {  
"store": true,  
"index": "not\_analyzed",  
"omit\_norms": true,  
"type": "string"  
},  
"userid": {  
"store": true,  
"index": "not\_analyzed",  
"omit\_norms": true,  
"type": "string"  
},  
"filesize": {  
"store": true,  
"index": "not\_analyzed",  
"type": "long"  
},  
"filename": {  
"store": true,  
"omit\_norms": true,  
"index\_analyzer": "def\_analyzer",  
"search\_analyzer": "def\_analyzer\_search",  
"type": "string"  
},  
"extension": {  
"analyzer": "keyword",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
},  
"modificationdate": {  
"store": true,  
"index": "not\_analyzed",  
"type": "date"  
},  
"timestamp": {  
"store": true,  
"index": "not\_analyzed",  
"type": "date"  
},  
"category": {  
"store": true,  
"index": "not\_analyzed",  
"type": "long"  
},  
"content\_ukw": {  
"analyzer": "def\_analyzer",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
},  
"content\_br": {  
"analyzer": "br\_analyzer",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
},  
"content\_da": {  
"analyzer": "da\_analyzer",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
},  
"content\_de": {  
"analyzer": "de\_analyzer",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
},  
"content\_en": {  
"analyzer": "en\_analyzer",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
},  
"content\_es": {  
"analyzer": "es\_analyzer",  
"store": true,  
"omit\_norms": true,  
"type": "string"  
}  
}  
}  
}'

#After indexing some data, do a search query  
curl -XPOST /files/rawfiles/\_search -d '{  
"from": 0,  
"size": 50,  
"sort": [  
{  
"_score": {  
"order": "desc"  
}  
}  
],  
"fields": [  
"filename",  
"filesize"  
],  
"aggs": {  
"extension": {  
"terms": {  
"field": "extension"  
}  
},  
"pagecount": {  
"terms": {  
"field": "pagecount"  
}  
},  
"dates": {  
"date\_range": {  
"field": "modificationdate",  
"format": "MM-yyyy",  
"ranges": [  
{  
"from": "now-1M/M",  
"to": "now",  
"key": "one\_month"  
},  
{  
"from": "now-3M/M",  
"to": "now-1M/M",  
"key": "three\_months"  
},  
{  
"from": "0",  
"to": "now-3M/M",  
"key": "old"  
}  
]  
}  
}  
},  
"query": {  
"multi\_match": {  
"query": "retracted",  
"fields": [  
"filename^3",  
"content_\*^2",  
"content\_ukw"  
]  
}  
}  
}'

#No hits will be returned without setting the store property to true for filename and content fileds

On Tuesday, April 21, 2015 at 1:59:33 PM UTC+3, David Pilato wrote:

> I don’t understand. Could you GIST a full recreation scripts which  
> demonstrate what you are seeing?
> 
> --  
> _David Pilato_ - Developer | Evangelist  
> _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> @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 21 avr. 2015 à 12:50, Zaid Amir \<[redse...@gmail.com](mailto:redse...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi,
> 
> I am having issues with ES. I have configured ES to store the \_source  
> field, however when I query I do not get any hits unless I "store" the  
> fields that I want to query. This is how my query request looks like:
> 
> {  
> "from": 0,  
> "size": 50,  
> "sort": [  
> {  
> "_score": {  
> "order": "desc"  
> }  
> }  
> ],  
> "fields": [  
> "filename",  
> "filesize"  
> ],  
> "aggs": {  
> "extension": {  
> "terms": {  
> "field": "extension"  
> }  
> },  
> "pagecount": {  
> "terms": {  
> "field": "pagecount"  
> }  
> },  
> "dates": {  
> "date\_range": {  
> "field": "modificationdate",  
> "format": "MM-yyyy",  
> "ranges": [  
> {  
> "from": "now-1M/M",  
> "to": "now",  
> "key": "one\_month"  
> },  
> {  
> "from": "now-3M/M",  
> "to": "now-1M/M",  
> "key": "three\_months"  
> },  
> {  
> "from": "0",  
> "to": "now-3M/M",  
> "key": "old"  
> }  
> ]  
> }  
> }  
> },  
> "query": {  
> "multi\_match": {  
> "query": "some string",  
> "fields": [  
> "filename^3",  
> "content_\*^2",  
> "content\_ukw"  
> ]  
> }  
> }  
> }
> 
> Unfortunately without storing the filename and the content\_ fileds, I do  
> not get any results and ES returns no hits.
> 
> --  
> 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/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%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/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%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:** [April 21, 2015, 12:10pm UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/4 "2015-04-21T12:10:43Z")

</div>

A full script is closed to what you sent.

Data are just missing here.  
Also, could you use GIST to post it?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 21 avr. 2015 à 13:54, Zaid Amir [redserpent7@gmail.com](mailto:redserpent7@gmail.com) a écrit :
> 
> Sorry, not sure what you mean by a recreation script. But here is how my index is created and mapped along with the search query
> 
> #Create an Index  
> curl -XPUT 'localhost:9200/files
> 
> #Create index mapping enabling \_source and disabling \_all fields  
> #Without the store property set to true, no results are returned
> 
> curl -XPUT /files/rawfiles/\_mapping -d '{  
> "rawfiles": {  
> "\_source": {  
> "enabled": true  
> },  
> "\_all": {  
> "enabled": false  
> },  
> "\_timestamp": {  
> "enabled": true,  
> "path": "timestamp"  
> },  
> "properties": {  
> "fileid": {  
> "store": true,  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "userid": {  
> "store": true,  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "filesize": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "long"  
> },  
> "filename": {  
> "store": true,  
> "omit\_norms": true,  
> "index\_analyzer": "def\_analyzer",  
> "search\_analyzer": "def\_analyzer\_search",  
> "type": "string"  
> },  
> "extension": {  
> "analyzer": "keyword",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "modificationdate": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "date"  
> },  
> "timestamp": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "date"  
> },  
> "category": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "long"  
> },  
> "content\_ukw": {  
> "analyzer": "def\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_br": {  
> "analyzer": "br\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_da": {  
> "analyzer": "da\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_de": {  
> "analyzer": "de\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_en": {  
> "analyzer": "en\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_es": {  
> "analyzer": "es\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> }  
> }  
> }  
> }'
> 
> #After indexing some data, do a search query  
> curl -XPOST /files/rawfiles/\_search -d '{  
> "from": 0,  
> "size": 50,  
> "sort": [  
> {  
> "_score": {  
> "order": "desc"  
> }  
> }  
> ],  
> "fields": [  
> "filename",  
> "filesize"  
> ],  
> "aggs": {  
> "extension": {  
> "terms": {  
> "field": "extension"  
> }  
> },  
> "pagecount": {  
> "terms": {  
> "field": "pagecount"  
> }  
> },  
> "dates": {  
> "date\_range": {  
> "field": "modificationdate",  
> "format": "MM-yyyy",  
> "ranges": [  
> {  
> "from": "now-1M/M",  
> "to": "now",  
> "key": "one\_month"  
> },  
> {  
> "from": "now-3M/M",  
> "to": "now-1M/M",  
> "key": "three\_months"  
> },  
> {  
> "from": "0",  
> "to": "now-3M/M",  
> "key": "old"  
> }  
> ]  
> }  
> }  
> },  
> "query": {  
> "multi\_match": {  
> "query": "retracted",  
> "fields": [  
> "filename^3",  
> "content_\*^2",  
> "content\_ukw"  
> ]  
> }  
> }  
> }'
> 
> #No hits will be returned without setting the store property to true for filename and content fileds
> 
> > On Tuesday, April 21, 2015 at 1:59:33 PM UTC+3, David Pilato wrote:  
> > I don’t understand. Could you GIST a full recreation scripts which demonstrate what you are seeing?
> > 
> > --  
> > David Pilato - Developer | Evangelist  
> > [elastic.co](http://elastic.co)  
> > @dadoonet | @elasticsearchfr | @scrutmydocs
> > 
> > > Le 21 avr. 2015 à 12:50, Zaid Amir [redse...@gmail.com](mailto:redse...@gmail.com) a écrit :
> > > 
> > > Hi,
> > > 
> > > I am having issues with ES. I have configured ES to store the \_source field, however when I query I do not get any hits unless I "store" the fields that I want to query. This is how my query request looks like:
> > > 
> > > {  
> > > "from": 0,  
> > > "size": 50,  
> > > "sort": [  
> > > {  
> > > "_score": {  
> > > "order": "desc"  
> > > }  
> > > }  
> > > ],  
> > > "fields": [  
> > > "filename",  
> > > "filesize"  
> > > ],  
> > > "aggs": {  
> > > "extension": {  
> > > "terms": {  
> > > "field": "extension"  
> > > }  
> > > },  
> > > "pagecount": {  
> > > "terms": {  
> > > "field": "pagecount"  
> > > }  
> > > },  
> > > "dates": {  
> > > "date\_range": {  
> > > "field": "modificationdate",  
> > > "format": "MM-yyyy",  
> > > "ranges": [  
> > > {  
> > > "from": "now-1M/M",  
> > > "to": "now",  
> > > "key": "one\_month"  
> > > },  
> > > {  
> > > "from": "now-3M/M",  
> > > "to": "now-1M/M",  
> > > "key": "three\_months"  
> > > },  
> > > {  
> > > "from": "0",  
> > > "to": "now-3M/M",  
> > > "key": "old"  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > },  
> > > "query": {  
> > > "multi\_match": {  
> > > "query": "some string",  
> > > "fields": [  
> > > "filename^3",  
> > > "content_\*^2",  
> > > "content\_ukw"  
> > > ]  
> > > }  
> > > }  
> > > }
> > > 
> > > Unfortunately without storing the filename and the content\_ fileds, I do not get any results and ES returns no hits.
> > > 
> > > --  
> > > 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).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com).  
> > > 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/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com).  
> 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/7BEBCF17-8F44-42EC-88F0-8BDB6C9403DA%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/7BEBCF17-8F44-42EC-88F0-8BDB6C9403DA%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![redserpent7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redserpent7/32/467_2.png) [@redserpent7](https://discuss.elastic.co/u/redserpent7)\
**Post date:** [April 21, 2015, 12:33pm UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/5 "2015-04-21T12:33:15Z")

</div>

If by data you mean the indexing calls, then I'm afraid they are too big to  
be any relevant. Also not sure what this could help with since I have no  
issues with creating, mapping or indexing data. As I said, what happens is  
once I change my fields' 'store' property to false, my queries stop  
returning hits. setting the 'store' property for the fields back to true  
will make it work. Both are done with the \_source field enabled.

On Tuesday, April 21, 2015 at 3:10:56 PM UTC+3, David Pilato wrote:

> A full script is closed to what you sent.
> 
> Data are just missing here.  
> Also, could you use GIST to post it?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 21 avr. 2015 à 13:54, Zaid Amir \<[redse...@gmail.com](mailto:redse...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Sorry, not sure what you mean by a recreation script. But here is how my  
> index is created and mapped along with the search query
> 
> #Create an Index  
> curl -XPUT 'localhost:9200/files
> 
> #Create index mapping enabling \_source and disabling \_all fields  
> #Without the store property set to true, no results are returned
> 
> curl -XPUT /files/rawfiles/\_mapping -d '{  
> "rawfiles": {  
> "\_source": {  
> "enabled": true  
> },  
> "\_all": {  
> "enabled": false  
> },  
> "\_timestamp": {  
> "enabled": true,  
> "path": "timestamp"  
> },  
> "properties": {  
> "fileid": {  
> "store": true,  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "userid": {  
> "store": true,  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "filesize": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "long"  
> },  
> "filename": {  
> "store": true,  
> "omit\_norms": true,  
> "index\_analyzer": "def\_analyzer",  
> "search\_analyzer": "def\_analyzer\_search",  
> "type": "string"  
> },  
> "extension": {  
> "analyzer": "keyword",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "modificationdate": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "date"  
> },  
> "timestamp": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "date"  
> },  
> "category": {  
> "store": true,  
> "index": "not\_analyzed",  
> "type": "long"  
> },  
> "content\_ukw": {  
> "analyzer": "def\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_br": {  
> "analyzer": "br\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_da": {  
> "analyzer": "da\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_de": {  
> "analyzer": "de\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_en": {  
> "analyzer": "en\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> },  
> "content\_es": {  
> "analyzer": "es\_analyzer",  
> "store": true,  
> "omit\_norms": true,  
> "type": "string"  
> }  
> }  
> }  
> }'
> 
> #After indexing some data, do a search query  
> curl -XPOST /files/rawfiles/\_search -d '{  
> "from": 0,  
> "size": 50,  
> "sort": [  
> {  
> "_score": {  
> "order": "desc"  
> }  
> }  
> ],  
> "fields": [  
> "filename",  
> "filesize"  
> ],  
> "aggs": {  
> "extension": {  
> "terms": {  
> "field": "extension"  
> }  
> },  
> "pagecount": {  
> "terms": {  
> "field": "pagecount"  
> }  
> },  
> "dates": {  
> "date\_range": {  
> "field": "modificationdate",  
> "format": "MM-yyyy",  
> "ranges": [  
> {  
> "from": "now-1M/M",  
> "to": "now",  
> "key": "one\_month"  
> },  
> {  
> "from": "now-3M/M",  
> "to": "now-1M/M",  
> "key": "three\_months"  
> },  
> {  
> "from": "0",  
> "to": "now-3M/M",  
> "key": "old"  
> }  
> ]  
> }  
> }  
> },  
> "query": {  
> "multi\_match": {  
> "query": "retracted",  
> "fields": [  
> "filename^3",  
> "content_\*^2",  
> "content\_ukw"  
> ]  
> }  
> }  
> }'
> 
> #No hits will be returned without setting the store property to true for filename and content fileds
> 
> On Tuesday, April 21, 2015 at 1:59:33 PM UTC+3, David Pilato wrote:
> 
> > I don’t understand. Could you GIST a full recreation scripts which  
> > demonstrate what you are seeing?
> > 
> > --  
> > _David Pilato_ - Developer | Evangelist  
> > _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> > @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 21 avr. 2015 à 12:50, Zaid Amir [redse...@gmail.com](mailto:redse...@gmail.com) a écrit :
> > 
> > Hi,
> > 
> > I am having issues with ES. I have configured ES to store the \_source  
> > field, however when I query I do not get any hits unless I "store" the  
> > fields that I want to query. This is how my query request looks like:
> > 
> > {  
> > "from": 0,  
> > "size": 50,  
> > "sort": [  
> > {  
> > "_score": {  
> > "order": "desc"  
> > }  
> > }  
> > ],  
> > "fields": [  
> > "filename",  
> > "filesize"  
> > ],  
> > "aggs": {  
> > "extension": {  
> > "terms": {  
> > "field": "extension"  
> > }  
> > },  
> > "pagecount": {  
> > "terms": {  
> > "field": "pagecount"  
> > }  
> > },  
> > "dates": {  
> > "date\_range": {  
> > "field": "modificationdate",  
> > "format": "MM-yyyy",  
> > "ranges": [  
> > {  
> > "from": "now-1M/M",  
> > "to": "now",  
> > "key": "one\_month"  
> > },  
> > {  
> > "from": "now-3M/M",  
> > "to": "now-1M/M",  
> > "key": "three\_months"  
> > },  
> > {  
> > "from": "0",  
> > "to": "now-3M/M",  
> > "key": "old"  
> > }  
> > ]  
> > }  
> > }  
> > },  
> > "query": {  
> > "multi\_match": {  
> > "query": "some string",  
> > "fields": [  
> > "filename^3",  
> > "content_\*^2",  
> > "content\_ukw"  
> > ]  
> > }  
> > }  
> > }
> > 
> > Unfortunately without storing the filename and the content\_ fileds, I do  
> > not get any results and ES returns no hits.
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%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/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%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:** [April 21, 2015, 2:08pm UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/6 "2015-04-21T14:08:36Z")

</div>

I’m not saying that you need to send all your data. But to send one document at least which is supposed to match.  
So then we can play with your script and try to fix it.

--  
David Pilato - Developer | Evangelist

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co/)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

@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 21 avr. 2015 à 14:33, Zaid Amir [redserpent7@gmail.com](mailto:redserpent7@gmail.com) a écrit :
> 
> If by data you mean the indexing calls, then I'm afraid they are too big to be any relevant. Also not sure what this could help with since I have no issues with creating, mapping or indexing data. As I said, what happens is once I change my fields' 'store' property to false, my queries stop returning hits. setting the 'store' property for the fields back to true will make it work. Both are done with the \_source field enabled.
> 
> On Tuesday, April 21, 2015 at 3:10:56 PM UTC+3, David Pilato wrote:  
> A full script is closed to what you sent.
> 
> Data are just missing here.  
> Also, could you use GIST to post it?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 21 avr. 2015 à 13:54, Zaid Amir \<[redse...@gmail.com](mailto:redse...@gmail.com) \<javascript:\>\> a écrit :
> 
> > Sorry, not sure what you mean by a recreation script. But here is how my index is created and mapped along with the search query
> > 
> > #Create an Index  
> > curl -XPUT 'localhost:9200/files
> > 
> > #Create index mapping enabling \_source and disabling \_all fields  
> > #Without the store property set to true, no results are returned
> > 
> > curl -XPUT /files/rawfiles/\_mapping -d '{  
> > "rawfiles": {  
> > "\_source": {  
> > "enabled": true  
> > },  
> > "\_all": {  
> > "enabled": false  
> > },  
> > "\_timestamp": {  
> > "enabled": true,  
> > "path": "timestamp"  
> > },  
> > "properties": {  
> > "fileid": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "userid": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "filesize": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "long"  
> > },  
> > "filename": {  
> > "store": true,  
> > "omit\_norms": true,  
> > "index\_analyzer": "def\_analyzer",  
> > "search\_analyzer": "def\_analyzer\_search",  
> > "type": "string"  
> > },  
> > "extension": {  
> > "analyzer": "keyword",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "modificationdate": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "date"  
> > },  
> > "timestamp": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "date"  
> > },  
> > "category": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "long"  
> > },  
> > "content\_ukw": {  
> > "analyzer": "def\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_br": {  
> > "analyzer": "br\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_da": {  
> > "analyzer": "da\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_de": {  
> > "analyzer": "de\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_en": {  
> > "analyzer": "en\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_es": {  
> > "analyzer": "es\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }'
> > 
> > #After indexing some data, do a search query  
> > curl -XPOST /files/rawfiles/\_search -d '{  
> > "from": 0,  
> > "size": 50,  
> > "sort": [  
> > {  
> > "_score": {  
> > "order": "desc"  
> > }  
> > }  
> > ],  
> > "fields": [  
> > "filename",  
> > "filesize"  
> > ],  
> > "aggs": {  
> > "extension": {  
> > "terms": {  
> > "field": "extension"  
> > }  
> > },  
> > "pagecount": {  
> > "terms": {  
> > "field": "pagecount"  
> > }  
> > },  
> > "dates": {  
> > "date\_range": {  
> > "field": "modificationdate",  
> > "format": "MM-yyyy",  
> > "ranges": [  
> > {  
> > "from": "now-1M/M",  
> > "to": "now",  
> > "key": "one\_month"  
> > },  
> > {  
> > "from": "now-3M/M",  
> > "to": "now-1M/M",  
> > "key": "three\_months"  
> > },  
> > {  
> > "from": "0",  
> > "to": "now-3M/M",  
> > "key": "old"  
> > }  
> > ]  
> > }  
> > }  
> > },  
> > "query": {  
> > "multi\_match": {  
> > "query": "retracted",  
> > "fields": [  
> > "filename^3",  
> > "content_\*^2",  
> > "content\_ukw"  
> > ]  
> > }  
> > }  
> > }'
> > 
> > #No hits will be returned without setting the store property to true for filename and content fileds
> > 
> > On Tuesday, April 21, 2015 at 1:59:33 PM UTC+3, David Pilato wrote:  
> > I don’t understand. Could you GIST a full recreation scripts which demonstrate what you are seeing?
> > 
> > --  
> > David Pilato - Developer | Evangelist  
> > [elastic.co](http://elastic.co) [http://elastic.co/](http://elastic.co/)  
> > @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 21 avr. 2015 à 12:50, Zaid Amir \<[redse...@gmail.com](mailto:redse...@gmail.com) \<\>\> a écrit :
> > > 
> > > Hi,
> > > 
> > > I am having issues with ES. I have configured ES to store the \_source field, however when I query I do not get any hits unless I "store" the fields that I want to query. This is how my query request looks like:
> > > 
> > > {  
> > > "from": 0,  
> > > "size": 50,  
> > > "sort": [  
> > > {  
> > > "_score": {  
> > > "order": "desc"  
> > > }  
> > > }  
> > > ],  
> > > "fields": [  
> > > "filename",  
> > > "filesize"  
> > > ],  
> > > "aggs": {  
> > > "extension": {  
> > > "terms": {  
> > > "field": "extension"  
> > > }  
> > > },  
> > > "pagecount": {  
> > > "terms": {  
> > > "field": "pagecount"  
> > > }  
> > > },  
> > > "dates": {  
> > > "date\_range": {  
> > > "field": "modificationdate",  
> > > "format": "MM-yyyy",  
> > > "ranges": [  
> > > {  
> > > "from": "now-1M/M",  
> > > "to": "now",  
> > > "key": "one\_month"  
> > > },  
> > > {  
> > > "from": "now-3M/M",  
> > > "to": "now-1M/M",  
> > > "key": "three\_months"  
> > > },  
> > > {  
> > > "from": "0",  
> > > "to": "now-3M/M",  
> > > "key": "old"  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > },  
> > > "query": {  
> > > "multi\_match": {  
> > > "query": "some string",  
> > > "fields": [  
> > > "filename^3",  
> > > "content_\*^2",  
> > > "content\_ukw"  
> > > ]  
> > > }  
> > > }  
> > > }
> > > 
> > > Unfortunately without storing the filename and the content\_ fileds, I do not get any results and ES returns no hits.
> > > 
> > > --  
> > > 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) \<\>.  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%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) [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/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%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/EDABC984-649D-443F-B4EC-7D1A96B34DBE%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/EDABC984-649D-443F-B4EC-7D1A96B34DBE%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![redserpent7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redserpent7/32/467_2.png) [@redserpent7](https://discuss.elastic.co/u/redserpent7)\
**Post date:** [April 22, 2015, 6:30am UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/7 "2015-04-22T06:30:54Z")

</div>

This is an index request that I have taken out of my \_bulk request. Hope it  
helps:

curl -XPOST [http://localhost:9200/\_bulk](http://localhost:9200/_bulk) -d '{  
"index" : {  
"\_index" : "files",  
"\_type" : "rawfiles",  
"\_id" : "130741557032361573\_equilibrating"  
}  
}{  
"content\_br" : ,  
"content\_da" : ,  
"content\_de" : ,  
"content\_en" : ["monism lasagnes beginner prepositional masterworks prince  
diluvium suggesting maharishi raceways quibble debauches virtuosity spurt  
narrater squads entranced iron latents beguiler delimitating banders  
creosoting stained macular protested russet whists cooling hoc  
resuscitation yukking pea oglers puffins covertly divulgement listless  
evince levitate crowded dandyism jeu prewashes blackened queenlier  
effeminate prorater remarriage nails sunk landowner"],  
"content\_es" : ,  
"content\_ukw" : ,  
"fileid" : "130741557032361573\_equilibrating",  
"userid" : "123456",  
"filesize" : "102633",  
"filename" : "130741557032361573\_equilibrating.txt",  
"extension" : "txt",  
"modificationdate" : "2015-04-22T08:55:03.1969749+03:00",  
"timestamp" : "2015-04-22T05:55:03.5139749Z",  
"category" : 0  
}'

On Tuesday, April 21, 2015 at 5:08:56 PM UTC+3, David Pilato wrote:

> I’m not saying that you need to send all your data. But to send one  
> document at least which is supposed to match.  
> So then we can play with your script and try to fix it.
> 
> --  
> _David Pilato_ - Developer | Evangelist  
> _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> @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 21 avr. 2015 à 14:33, Zaid Amir \<[redse...@gmail.com](mailto:redse...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> If by data you mean the indexing calls, then I'm afraid they are too big  
> to be any relevant. Also not sure what this could help with since I have no  
> issues with creating, mapping or indexing data. As I said, what happens is  
> once I change my fields' 'store' property to false, my queries stop  
> returning hits. setting the 'store' property for the fields back to true  
> will make it work. Both are done with the \_source field enabled.
> 
> On Tuesday, April 21, 2015 at 3:10:56 PM UTC+3, David Pilato wrote:
> 
> > A full script is closed to what you sent.
> > 
> > Data are just missing here.  
> > Also, could you use GIST to post it?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 21 avr. 2015 à 13:54, Zaid Amir [redse...@gmail.com](mailto:redse...@gmail.com) a écrit :
> > 
> > Sorry, not sure what you mean by a recreation script. But here is how my  
> > index is created and mapped along with the search query
> > 
> > #Create an Index  
> > curl -XPUT 'localhost:9200/files
> > 
> > #Create index mapping enabling \_source and disabling \_all fields  
> > #Without the store property set to true, no results are returned
> > 
> > curl -XPUT /files/rawfiles/\_mapping -d '{  
> > "rawfiles": {  
> > "\_source": {  
> > "enabled": true  
> > },  
> > "\_all": {  
> > "enabled": false  
> > },  
> > "\_timestamp": {  
> > "enabled": true,  
> > "path": "timestamp"  
> > },  
> > "properties": {  
> > "fileid": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "userid": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "filesize": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "long"  
> > },  
> > "filename": {  
> > "store": true,  
> > "omit\_norms": true,  
> > "index\_analyzer": "def\_analyzer",  
> > "search\_analyzer": "def\_analyzer\_search",  
> > "type": "string"  
> > },  
> > "extension": {  
> > "analyzer": "keyword",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "modificationdate": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "date"  
> > },  
> > "timestamp": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "date"  
> > },  
> > "category": {  
> > "store": true,  
> > "index": "not\_analyzed",  
> > "type": "long"  
> > },  
> > "content\_ukw": {  
> > "analyzer": "def\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_br": {  
> > "analyzer": "br\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_da": {  
> > "analyzer": "da\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_de": {  
> > "analyzer": "de\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_en": {  
> > "analyzer": "en\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > },  
> > "content\_es": {  
> > "analyzer": "es\_analyzer",  
> > "store": true,  
> > "omit\_norms": true,  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }'
> > 
> > #After indexing some data, do a search query  
> > curl -XPOST /files/rawfiles/\_search -d '{  
> > "from": 0,  
> > "size": 50,  
> > "sort": [  
> > {  
> > "_score": {  
> > "order": "desc"  
> > }  
> > }  
> > ],  
> > "fields": [  
> > "filename",  
> > "filesize"  
> > ],  
> > "aggs": {  
> > "extension": {  
> > "terms": {  
> > "field": "extension"  
> > }  
> > },  
> > "pagecount": {  
> > "terms": {  
> > "field": "pagecount"  
> > }  
> > },  
> > "dates": {  
> > "date\_range": {  
> > "field": "modificationdate",  
> > "format": "MM-yyyy",  
> > "ranges": [  
> > {  
> > "from": "now-1M/M",  
> > "to": "now",  
> > "key": "one\_month"  
> > },  
> > {  
> > "from": "now-3M/M",  
> > "to": "now-1M/M",  
> > "key": "three\_months"  
> > },  
> > {  
> > "from": "0",  
> > "to": "now-3M/M",  
> > "key": "old"  
> > }  
> > ]  
> > }  
> > }  
> > },  
> > "query": {  
> > "multi\_match": {  
> > "query": "retracted",  
> > "fields": [  
> > "filename^3",  
> > "content_\*^2",  
> > "content\_ukw"  
> > ]  
> > }  
> > }  
> > }'
> > 
> > #No hits will be returned without setting the store property to true for filename and content fileds
> > 
> > On Tuesday, April 21, 2015 at 1:59:33 PM UTC+3, David Pilato wrote:
> > 
> > > I don’t understand. Could you GIST a full recreation scripts which  
> > > demonstrate what you are seeing?
> > > 
> > > --  
> > > _David Pilato_ - Developer | Evangelist  
> > > _[elastic.co](http://elastic.co) [http://elastic.co/](http://elastic.co/)_  
> > > @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 21 avr. 2015 à 12:50, Zaid Amir [redse...@gmail.com](mailto:redse...@gmail.com) a écrit :
> > > 
> > > Hi,
> > > 
> > > I am having issues with ES. I have configured ES to store the \_source  
> > > field, however when I query I do not get any hits unless I "store" the  
> > > fields that I want to query. This is how my query request looks like:
> > > 
> > > {  
> > > "from": 0,  
> > > "size": 50,  
> > > "sort": [  
> > > {  
> > > "_score": {  
> > > "order": "desc"  
> > > }  
> > > }  
> > > ],  
> > > "fields": [  
> > > "filename",  
> > > "filesize"  
> > > ],  
> > > "aggs": {  
> > > "extension": {  
> > > "terms": {  
> > > "field": "extension"  
> > > }  
> > > },  
> > > "pagecount": {  
> > > "terms": {  
> > > "field": "pagecount"  
> > > }  
> > > },  
> > > "dates": {  
> > > "date\_range": {  
> > > "field": "modificationdate",  
> > > "format": "MM-yyyy",  
> > > "ranges": [  
> > > {  
> > > "from": "now-1M/M",  
> > > "to": "now",  
> > > "key": "one\_month"  
> > > },  
> > > {  
> > > "from": "now-3M/M",  
> > > "to": "now-1M/M",  
> > > "key": "three\_months"  
> > > },  
> > > {  
> > > "from": "0",  
> > > "to": "now-3M/M",  
> > > "key": "old"  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > },  
> > > "query": {  
> > > "multi\_match": {  
> > > "query": "some string",  
> > > "fields": [  
> > > "filename^3",  
> > > "content_\*^2",  
> > > "content\_ukw"  
> > > ]  
> > > }  
> > > }  
> > > }
> > > 
> > > Unfortunately without storing the filename and the content\_ fileds, I do  
> > > not get any results and ES returns no hits.
> > > 
> > > --  
> > > 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).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4aeb3736-ba27-4934-b655-15b53d14b8a1%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9139d0cb-58e3-482e-add6-b0bf0e4b58a9%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46d991a4-21f5-4e04-8d9c-37c31e7a63e7%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/1f4e34ac-fcad-4c2a-adc8-2893ce6c0503%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1f4e34ac-fcad-4c2a-adc8-2893ce6c0503%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:18am UTC](https://discuss.elastic.co/t/no-hits-if-fields-are-not-stored/23342/8 "2017-07-06T00:18:25Z")

</div>


