# Elasticsearch not returning all relevant results

**URL:** <https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544>\
**Category:** Elasticsearch\
**Created:** [September 10, 2013, 11:04pm UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544 "2013-09-10T23:04:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![KS1](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@KS1](https://discuss.elastic.co/u/KS1)\
**Post date:** [September 10, 2013, 11:04pm UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/1 "2013-09-10T23:04:35Z")

</div>

I am using elastic search to search for files stored in MongoDB. I would  
like to retrieve all files whose name match a pattern. When I queried in  
MongoDB it returns 6754 files.

```
FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();

6754

```

But when I tried to do the same with elastic search it return only 85  
files. Any way to get all the files in elastic search?

```
curl -XGET 

```

"localhost:9200/submission\_idx/files/\_search?search\_type=scan&scroll=10m&size=7000&pretty=1"  
-d '{"query" : {  
"field" : {  
"filename" : "_Mail_"  
}  
}  
}'

```
{
  "_scroll_id" : 

```

"c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",  
"took" : 8,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 85,  
"max\_score" : 0.0,  
"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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [September 11, 2013, 1:35am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/2 "2013-09-11T01:35:31Z")

</div>

How did you index those documents in elasticsearch?  
What gives:

curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"

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

Le 11 sept. 2013 à 01:04, KS [kiruthi.s19@gmail.com](mailto:kiruthi.s19@gmail.com) a écrit :

I am using elastic search to search for files stored in MongoDB. I would like to retrieve all files whose name match a pattern. When I queried in MongoDB it returns 6754 files.

```
FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();

6754

```

But when I tried to do the same with elastic search it return only 85 files. Any way to get all the files in elastic search?

```
curl -XGET "localhost:9200/submission_idx/files/_search?search_type=scan&scroll=10m&size=7000&pretty=1" -d '{"query" : {
"field" : {
        "filename" : "*Mail*"
    }                           
}                            
}'

{
  "_scroll_id" : "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",
  "took" : 8,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 85,
    "max_score" : 0.0,
    "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).  
For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![KS1](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@KS1](https://discuss.elastic.co/u/KS1)\
**Post date:** [September 11, 2013, 3:45am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/3 "2013-09-11T03:45:35Z")

</div>

Hi David,

Please find the detail you asked for below:

curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"  
{  
"count" : 34591,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
}

Also I used the below code to create index in elasticsearch:

curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
{  
"type": "mongodb",  
"mongodb": {  
"db": "submission\_data",  
"collection": "fs",  
"gridfs": true  
},  
"index": {  
"name": "submission\_idx",  
"type": "files",  
"content\_type": "text/plain"  
}  
}'

On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:

> How did you index those documents in elasticsearch?  
> What gives:
> 
> curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 01:04, KS \<[kirut...@gmail.com](mailto:kirut...@gmail.com) \<javascript:\>\> a écrit :
> 
> I am using Elasticsearch to search for files stored in MongoDB. I would  
> like to retrieve all files whose name match a pattern. When I queried in  
> MongoDB it returns 6754 files.
> 
> ```
> FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> 
> 6754
> 
> ```
> 
> But when I tried to do the same with Elasticsearch it return only 85  
> files. Any way to get all the files in Elasticsearch?
> 
> ```
> curl -XGET 
> 
> ```
> 
> "localhost:9200/submission\_idx/files/\_search?search\_type=scan&scroll=10m&size=7000&pretty=1"  
> -d '{"query" : {  
> "field" : {  
> "filename" : "_Mail_"  
> }  
> }  
> }'
> 
> ```
> {
> "_scroll_id" : 
> 
> ```
> 
> "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",  
> "took" : 8,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 85,  
> "max\_score" : 0.0,  
> "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:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![KS1](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@KS1](https://discuss.elastic.co/u/KS1)\
**Post date:** [September 11, 2013, 4:24am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/4 "2013-09-11T04:24:54Z")

</div>

Hi David,

Please find the detail you asked for below:

curl -XGET "localhost:9200/submission\_  
idx/files/\_count?pretty"  
{  
"count" : 34591,

"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
}

Also I used the below code to create index in elasticsearch:

curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
{  
"type": "mongodb",  
"mongodb": {  
"db": "submission\_data",  
"collection": "fs",  
"gridfs": true  
},  
"index": {  
"name": "submission\_idx",  
"type": "files",  
"content\_type": "text/plain"  
}  
}'

After running the query you gave I found out that all my files in MongoDB  
have not been indexed by Elasticsearch. I have 1637870 files in DB but only  
34591 files have been indexed. Why did not Elasticsearch index rest of the  
files?

Appreciate your help.

Thanks,  
Kiruthika

On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:

> How did you index those documents in elasticsearch?  
> What gives:
> 
> curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 01:04, KS \<[kirut...@gmail.com](mailto:kirut...@gmail.com) \<javascript:\>\> a écrit :
> 
> I am using Elasticsearch to search for files stored in MongoDB. I would  
> like to retrieve all files whose name match a pattern. When I queried in  
> MongoDB it returns 6754 files.
> 
> ```
> FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> 
> 6754
> 
> ```
> 
> But when I tried to do the same with Elasticsearch it return only 85  
> files. Any way to get all the files in Elasticsearch?
> 
> ```
> curl -XGET 
> 
> ```
> 
> "localhost:9200/submission\_idx/files/\_search?search\_type=scan&scroll=10m&size=7000&pretty=1"  
> -d '{"query" : {  
> "field" : {  
> "filename" : "_Mail_"  
> }  
> }  
> }'
> 
> ```
> {
> "_scroll_id" : 
> 
> ```
> 
> "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",  
> "took" : 8,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 85,  
> "max\_score" : 0.0,  
> "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:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [September 11, 2013, 5:38am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/5 "2013-09-11T05:38:37Z")

</div>

And what gives:

curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"

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

Le 11 sept. 2013 à 06:24, KS [kiruthi.s19@gmail.com](mailto:kiruthi.s19@gmail.com) a écrit :

Hi David,

Please find the detail you asked for below:

curl -XGET "localhost:9200/submission\_  
idx/files/\_count?pretty"  
{  
"count" : 34591,

"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
}

Also I used the below code to create index in elasticsearch:

curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
{  
"type": "mongodb",  
"mongodb": {  
"db": "submission\_data",  
"collection": "fs",  
"gridfs": true  
},  
"index": {  
"name": "submission\_idx",  
"type": "files",  
"content\_type": "text/plain"  
}  
}'

After running the query you gave I found out that all my files in MongoDB have not been indexed by Elasticsearch. I have 1637870 files in DB but only 34591 files have been indexed. Why did not Elasticsearch index rest of the files?

Appreciate your help.

Thanks,  
Kiruthika

On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:

> How did you index those documents in elasticsearch?  
> What gives:
> 
> curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 01:04, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> 
> I am using Elasticsearch to search for files stored in MongoDB. I would like to retrieve all files whose name match a pattern. When I queried in MongoDB it returns 6754 files.
> 
> ```
> FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> 
> 6754
> 
> ```
> 
> But when I tried to do the same with Elasticsearch it return only 85 files. Any way to get all the files in Elasticsearch?
> 
> ```
> curl -XGET "localhost:9200/submission_idx/files/_search?search_type=scan&scroll=10m&size=7000&pretty=1" -d '{"query" : {
> "field" : {
> "filename" : "*Mail*"
> }                           
> }                            
> }'
> 
> {
> "_scroll_id" : "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",
> "took" : 8,
> "timed_out" : false,
> "_shards" : {
> "total" : 5,
> "successful" : 5,
> "failed" : 0
> },
> "hits" : {
> "total" : 85,
> "max_score" : 0.0,
> "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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![KS1](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@KS1](https://discuss.elastic.co/u/KS1)\
**Post date:** [September 11, 2013, 6:09am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/6 "2013-09-11T06:09:45Z")

</div>

Hi David, I ran the curl command and it returns only 85 files. Could it be  
the reason that Elasticsearch returns only 85 files because it has not  
indexed all the files present in MongoDB? Elasticsearch have indexed only  
34591 files whereas I have 1637870 files in DB. Any idea on why it have not  
indexed all the files?

curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"  
{  
"count" : 85,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
}  
}

Thanks much,  
Kiruthika

On Tuesday, September 10, 2013 10:38:37 PM UTC-7, David Pilato wrote:

> And what gives:
> 
> curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 06:24, KS \<[kirut...@gmail.com](mailto:kirut...@gmail.com) \<javascript:\>\> a écrit :
> 
> Hi David,
> 
> Please find the detail you asked for below:
> 
> curl -XGET "localhost:9200/submission\_  
> idx/files/\_count?pretty"  
> {  
> "count" : 34591,
> 
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> }
> 
> Also I used the below code to create index in elasticsearch:
> 
> curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
> {  
> "type": "mongodb",  
> "mongodb": {  
> "db": "submission\_data",  
> "collection": "fs",  
> "gridfs": true  
> },  
> "index": {  
> "name": "submission\_idx",  
> "type": "files",  
> "content\_type": "text/plain"  
> }  
> }'
> 
> After running the query you gave I found out that all my files in MongoDB  
> have not been indexed by Elasticsearch. I have 1637870 files in DB but only  
> 34591 files have been indexed. Why did not Elasticsearch index rest of the  
> files?
> 
> Appreciate your help.
> 
> Thanks,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:
> 
> > How did you index those documents in elasticsearch?  
> > What gives:
> > 
> > curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 11 sept. 2013 à 01:04, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > 
> > I am using Elasticsearch to search for files stored in MongoDB. I would  
> > like to retrieve all files whose name match a pattern. When I queried in  
> > MongoDB it returns 6754 files.
> > 
> > ```
> > FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> > 
> > 6754
> > 
> > ```
> > 
> > But when I tried to do the same with Elasticsearch it return only 85  
> > files. Any way to get all the files in Elasticsearch?
> > 
> > ```
> > curl -XGET 
> > 
> > ```
> > 
> > "localhost:9200/submission\_idx/files/\_search?search\_type=scan&scroll=10m&size=7000&pretty=1"  
> > -d '{"query" : {  
> > "field" : {  
> > "filename" : "_Mail_"  
> > }  
> > }  
> > }'
> > 
> > ```
> > {
> > "_scroll_id" : 
> > 
> > ```
> > 
> > "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",  
> > "took" : 8,  
> > "timed\_out" : false,  
> > "\_shards" : {  
> > "total" : 5,  
> > "successful" : 5,  
> > "failed" : 0  
> > },  
> > "hits" : {  
> > "total" : 85,  
> > "max\_score" : 0.0,  
> > "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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [September 11, 2013, 6:46am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/7 "2013-09-11T06:46:33Z")

</div>

Probably. I was not aware that you don't have the same number of docs on both systems.  
I don't have any idea why you have this difference.

I would recommend to check your logs, check if some docs have the same Id and then are updated and not added.

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

Le 11 sept. 2013 à 08:09, KS [kiruthi.s19@gmail.com](mailto:kiruthi.s19@gmail.com) a écrit :

Hi David, I ran the curl command and it returns only 85 files. Could it be the reason that Elasticsearch returns only 85 files because it has not indexed all the files present in MongoDB? Elasticsearch have indexed only 34591 files whereas I have 1637870 files in DB. Any idea on why it have not indexed all the files?

curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"  
{  
"count" : 85,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
}  
}

Thanks much,  
Kiruthika

On Tuesday, September 10, 2013 10:38:37 PM UTC-7, David Pilato wrote:

> And what gives:
> 
> curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 06:24, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> 
> Hi David,
> 
> Please find the detail you asked for below:
> 
> curl -XGET "localhost:9200/submission\_  
> idx/files/\_count?pretty"  
> {  
> "count" : 34591,
> 
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> }
> 
> Also I used the below code to create index in elasticsearch:
> 
> curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
> {  
> "type": "mongodb",  
> "mongodb": {  
> "db": "submission\_data",  
> "collection": "fs",  
> "gridfs": true  
> },  
> "index": {  
> "name": "submission\_idx",  
> "type": "files",  
> "content\_type": "text/plain"  
> }  
> }'
> 
> After running the query you gave I found out that all my files in MongoDB have not been indexed by Elasticsearch. I have 1637870 files in DB but only 34591 files have been indexed. Why did not Elasticsearch index rest of the files?
> 
> Appreciate your help.
> 
> Thanks,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:
> 
> > How did you index those documents in elasticsearch?  
> > What gives:
> > 
> > curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 11 sept. 2013 à 01:04, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > 
> > I am using Elasticsearch to search for files stored in MongoDB. I would like to retrieve all files whose name match a pattern. When I queried in MongoDB it returns 6754 files.
> > 
> > ```
> > FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> > 
> > 6754
> > 
> > ```
> > 
> > But when I tried to do the same with Elasticsearch it return only 85 files. Any way to get all the files in Elasticsearch?
> > 
> > ```
> > curl -XGET "localhost:9200/submission_idx/files/_search?search_type=scan&scroll=10m&size=7000&pretty=1" -d '{"query" : {
> > "field" : {
> > "filename" : "*Mail*"
> > }                           
> > }                            
> > }'
> > 
> > {
> > "_scroll_id" : "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",
> > "took" : 8,
> > "timed_out" : false,
> > "_shards" : {
> > "total" : 5,
> > "successful" : 5,
> > "failed" : 0
> > },
> > "hits" : {
> > "total" : 85,
> > "max_score" : 0.0,
> > "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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![KS1](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@KS1](https://discuss.elastic.co/u/KS1)\
**Post date:** [September 11, 2013, 8:37am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/8 "2013-09-11T08:37:18Z")

</div>

Hi David, sorry it was my mistake. The problem was that elasticsearch was  
not indexing all the documents. I tried to re-index all the documents but  
still I am not able to index all the documents. When I checked the log file  
there is no error but I found the below line for some files. Is this an  
error?

[2013-09-11 01:14:10,955][INFO][river.mongodb] [Jennifer  
Walters] [mongodb][subfs] Caught file: 522bef2325d9bfa684efe087 -  
/data/Test.java

Thanks,  
Kiruthika

On Tuesday, September 10, 2013 11:46:33 PM UTC-7, David Pilato wrote:

> Probably. I was not aware that you don't have the same number of docs on  
> both systems.  
> I don't have any idea why you have this difference.
> 
> I would recommend to check your logs, check if some docs have the same Id  
> and then are updated and not added.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 08:09, KS \<[kirut...@gmail.com](mailto:kirut...@gmail.com) \<javascript:\>\> a écrit :
> 
> Hi David, I ran the curl command and it returns only 85 files. Could it be  
> the reason that Elasticsearch returns only 85 files because it has not  
> indexed all the files present in MongoDB? Elasticsearch have indexed only  
> 34591 files whereas I have 1637870 files in DB. Any idea on why it have not  
> indexed all the files?
> 
> curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"  
> {  
> "count" : 85,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> }  
> }
> 
> Thanks much,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 10:38:37 PM UTC-7, David Pilato wrote:
> 
> > And what gives:
> > 
> > curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_  
> > "
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 11 sept. 2013 à 06:24, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > 
> > Hi David,
> > 
> > Please find the detail you asked for below:
> > 
> > curl -XGET "localhost:9200/submission\_  
> > idx/files/\_count?pretty"  
> > {  
> > "count" : 34591,
> > 
> > "\_shards" : {  
> > "total" : 5,  
> > "successful" : 5,  
> > "failed" : 0  
> > }
> > 
> > Also I used the below code to create index in elasticsearch:
> > 
> > curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
> > {  
> > "type": "mongodb",  
> > "mongodb": {  
> > "db": "submission\_data",  
> > "collection": "fs",  
> > "gridfs": true  
> > },  
> > "index": {  
> > "name": "submission\_idx",  
> > "type": "files",  
> > "content\_type": "text/plain"  
> > }  
> > }'
> > 
> > After running the query you gave I found out that all my files in MongoDB  
> > have not been indexed by Elasticsearch. I have 1637870 files in DB but only  
> > 34591 files have been indexed. Why did not Elasticsearch index rest of the  
> > files?
> > 
> > Appreciate your help.
> > 
> > Thanks,  
> > Kiruthika
> > 
> > On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:
> > 
> > > How did you index those documents in elasticsearch?  
> > > What gives:
> > > 
> > > curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 11 sept. 2013 à 01:04, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > > 
> > > I am using Elasticsearch to search for files stored in MongoDB. I would  
> > > like to retrieve all files whose name match a pattern. When I queried in  
> > > MongoDB it returns 6754 files.
> > > 
> > > ```
> > > FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> > > 
> > > 6754
> > > 
> > > ```
> > > 
> > > But when I tried to do the same with Elasticsearch it return only 85  
> > > files. Any way to get all the files in Elasticsearch?
> > > 
> > > ```
> > > curl -XGET 
> > > 
> > > ```
> > > 
> > > "localhost:9200/submission\_idx/files/\_search?search\_type=scan&scroll=10m&size=7000&pretty=1"  
> > > -d '{"query" : {  
> > > "field" : {  
> > > "filename" : "_Mail_"  
> > > }  
> > > }  
> > > }'
> > > 
> > > ```
> > > {
> > > "_scroll_id" : 
> > > 
> > > ```
> > > 
> > > "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",  
> > > "took" : 8,  
> > > "timed\_out" : false,  
> > > "\_shards" : {  
> > > "total" : 5,  
> > > "successful" : 5,  
> > > "failed" : 0  
> > > },  
> > > "hits" : {  
> > > "total" : 85,  
> > > "max\_score" : 0.0,  
> > > "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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [September 11, 2013, 9:35am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/9 "2013-09-11T09:35:39Z")

</div>

I don't know.  
I did not create the mongodb river.

I think Richard Louapre could answer here.

What I have seen in the past about attachments is that you can hit the maximum default extracted chars (defaults to 100000). See [GitHub - elastic/elasticsearch-mapper-attachments: Mapper Attachments Type plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-mapper-attachments#indexed-characters)

## HTH

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

Le 11 sept. 2013 à 10:37, KS [kiruthi.s19@gmail.com](mailto:kiruthi.s19@gmail.com) a écrit :

> Hi David, sorry it was my mistake. The problem was that elasticsearch was not indexing all the documents. I tried to re-index all the documents but still I am not able to index all the documents. When I checked the log file there is no error but I found the below line for some files. Is this an error?
> 
> [2013-09-11 01:14:10,955][INFO][river.mongodb] [Jennifer Walters] [mongodb][subfs] Caught file: 522bef2325d9bfa684efe087 - /data/Test.java
> 
> Thanks,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 11:46:33 PM UTC-7, David Pilato wrote:  
> Probably. I was not aware that you don't have the same number of docs on both systems.  
> I don't have any idea why you have this difference.
> 
> I would recommend to check your logs, check if some docs have the same Id and then are updated and not added.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 08:09, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> 
> Hi David, I ran the curl command and it returns only 85 files. Could it be the reason that Elasticsearch returns only 85 files because it has not indexed all the files present in MongoDB? Elasticsearch have indexed only 34591 files whereas I have 1637870 files in DB. Any idea on why it have not indexed all the files?
> 
> curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"  
> {  
> "count" : 85,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> }  
> }
> 
> Thanks much,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 10:38:37 PM UTC-7, David Pilato wrote:  
> And what gives:
> 
> curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 06:24, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> 
> Hi David,
> 
> Please find the detail you asked for below:
> 
> curl -XGET "localhost:9200/submission\_  
> idx/files/\_count?pretty"  
> {  
> "count" : 34591,
> 
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> }
> 
> Also I used the below code to create index in elasticsearch:
> 
> curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
> {  
> "type": "mongodb",  
> "mongodb": {  
> "db": "submission\_data",  
> "collection": "fs",  
> "gridfs": true  
> },  
> "index": {  
> "name": "submission\_idx",  
> "type": "files",  
> "content\_type": "text/plain"  
> }  
> }'
> 
> After running the query you gave I found out that all my files in MongoDB have not been indexed by Elasticsearch. I have 1637870 files in DB but only 34591 files have been indexed. Why did not Elasticsearch index rest of the files?
> 
> Appreciate your help.
> 
> Thanks,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:  
> How did you index those documents in elasticsearch?  
> What gives:
> 
> curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 11 sept. 2013 à 01:04, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> 
> I am using Elasticsearch to search for files stored in MongoDB. I would like to retrieve all files whose name match a pattern. When I queried in MongoDB it returns 6754 files.
> 
> ```
> FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> 
> 6754
> 
> ```
> 
> But when I tried to do the same with Elasticsearch it return only 85 files. Any way to get all the files in Elasticsearch?
> 
> ```
> curl -XGET "localhost:9200/submission_idx/files/_search?search_type=scan&scroll=10m&size=7000&pretty=1" -d '{"query" : {
> "field" : {
> "filename" : "*Mail*"
> }                           
> }                            
> }'
> 
> {
> "_scroll_id" : "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",
> "took" : 8,
> "timed_out" : false,
> "_shards" : {
> "total" : 5,
> "successful" : 5,
> "failed" : 0
> },
> "hits" : {
> "total" : 85,
> "max_score" : 0.0,
> "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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![KS1](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@KS1](https://discuss.elastic.co/u/KS1)\
**Post date:** [September 11, 2013, 9:42am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/10 "2013-09-11T09:42:33Z")

</div>

Thank you David!

On Wednesday, September 11, 2013 2:35:39 AM UTC-7, David Pilato wrote:

> I don't know.  
> I did not create the mongodb river.
> 
> I think Richard Louapre could answer here.
> 
> What I have seen in the past about attachments is that you can hit the  
> maximum default extracted chars (defaults to 100000). See  
> [GitHub - elastic/elasticsearch-mapper-attachments: Mapper Attachments Type plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-mapper-attachments#indexed-characters)
> 
> ## HTH
> 
> _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 11 sept. 2013 à 10:37, KS \<[kirut...@gmail.com](mailto:kirut...@gmail.com) \<javascript:\>\> a écrit :
> 
> Hi David, sorry it was my mistake. The problem was that elasticsearch was  
> not indexing all the documents. I tried to re-index all the documents but  
> still I am not able to index all the documents. When I checked the log file  
> there is no error but I found the below line for some files. Is this an  
> error?
> 
> [2013-09-11 01:14:10,955][INFO][river.mongodb] [Jennifer  
> Walters] [mongodb][subfs] Caught file: 522bef2325d9bfa684efe087 -  
> /data/Test.java
> 
> Thanks,  
> Kiruthika
> 
> On Tuesday, September 10, 2013 11:46:33 PM UTC-7, David Pilato wrote:
> 
> > Probably. I was not aware that you don't have the same number of docs on  
> > both systems.  
> > I don't have any idea why you have this difference.
> > 
> > I would recommend to check your logs, check if some docs have the same Id  
> > and then are updated and not added.
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 11 sept. 2013 à 08:09, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > 
> > Hi David, I ran the curl command and it returns only 85 files. Could it  
> > be the reason that Elasticsearch returns only 85 files because it has not  
> > indexed all the files present in MongoDB? Elasticsearch have indexed only  
> > 34591 files whereas I have 1637870 files in DB. Any idea on why it have not  
> > indexed all the files?
> > 
> > curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:_Mail_"  
> > {  
> > "count" : 85,  
> > "\_shards" : {  
> > "total" : 5,  
> > "successful" : 5,  
> > "failed" : 0  
> > }  
> > }
> > 
> > Thanks much,  
> > Kiruthika
> > 
> > On Tuesday, September 10, 2013 10:38:37 PM UTC-7, David Pilato wrote:
> > 
> > > And what gives:
> > > 
> > > curl "localhost:9200/submission\_idx/files/\_count?pretty&q=filename:  
> > > _Mail_"
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 11 sept. 2013 à 06:24, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > > 
> > > Hi David,
> > > 
> > > Please find the detail you asked for below:
> > > 
> > > curl -XGET "localhost:9200/submission\_  
> > > idx/files/\_count?pretty"  
> > > {  
> > > "count" : 34591,
> > > 
> > > "\_shards" : {  
> > > "total" : 5,  
> > > "successful" : 5,  
> > > "failed" : 0  
> > > }
> > > 
> > > Also I used the below code to create index in elasticsearch:
> > > 
> > > curl -XPUT "localhost:9200/\_river/fs/\_meta" -d'  
> > > {  
> > > "type": "mongodb",  
> > > "mongodb": {  
> > > "db": "submission\_data",  
> > > "collection": "fs",  
> > > "gridfs": true  
> > > },  
> > > "index": {  
> > > "name": "submission\_idx",  
> > > "type": "files",  
> > > "content\_type": "text/plain"  
> > > }  
> > > }'
> > > 
> > > After running the query you gave I found out that all my files in  
> > > MongoDB have not been indexed by Elasticsearch. I have 1637870 files in DB  
> > > but only 34591 files have been indexed. Why did not Elasticsearch index  
> > > rest of the files?
> > > 
> > > Appreciate your help.
> > > 
> > > Thanks,  
> > > Kiruthika
> > > 
> > > On Tuesday, September 10, 2013 6:35:31 PM UTC-7, David Pilato wrote:
> > > 
> > > > How did you index those documents in elasticsearch?  
> > > > What gives:
> > > > 
> > > > curl -XGET "localhost:9200/submission\_idx/files/\_count?pretty"
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 11 sept. 2013 à 01:04, KS [kirut...@gmail.com](mailto:kirut...@gmail.com) a écrit :
> > > > 
> > > > I am using Elasticsearch to search for files stored in MongoDB. I  
> > > > would like to retrieve all files whose name match a pattern. When I queried  
> > > > in MongoDB it returns 6754 files.
> > > > 
> > > > ```
> > > > FSsearch:PRIMARY> db.fs.files.find({"filename":/.*Mail.*/}).count();
> > > > 
> > > > 6754
> > > > 
> > > > ```
> > > > 
> > > > But when I tried to do the same with Elasticsearch it return only 85  
> > > > files. Any way to get all the files in Elasticsearch?
> > > > 
> > > > ```
> > > > curl -XGET 
> > > > 
> > > > ```
> > > > 
> > > > "localhost:9200/submission\_idx/files/\_search?search\_type=scan&scroll=10m&size=7000&pretty=1"  
> > > > -d '{"query" : {  
> > > > "field" : {  
> > > > "filename" : "_Mail_"  
> > > > }  
> > > > }  
> > > > }'
> > > > 
> > > > ```
> > > > {
> > > > "_scroll_id" : 
> > > > 
> > > > ```
> > > > 
> > > > "c2Nhbjs1OzIyMDpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxODpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNjpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxOTpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzIxNzpDV21tamdEbVEyZUhOcVcwYWVnVU9ROzE7dG90YWxfaGl0czo4NTs=",  
> > > > "took" : 8,  
> > > > "timed\_out" : false,  
> > > > "\_shards" : {  
> > > > "total" : 5,  
> > > > "successful" : 5,  
> > > > "failed" : 0  
> > > > },  
> > > > "hits" : {  
> > > > "total" : 85,  
> > > > "max\_score" : 0.0,  
> > > > "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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:17am UTC](https://discuss.elastic.co/t/elasticsearch-not-returning-all-relevant-results/13544/11 "2017-07-06T02:17:07Z")

</div>


