# Cannot search the field of the attachment type?

**URL:** <https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120>\
**Category:** Elasticsearch\
**Created:** [January 7, 2014, 6:52am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120 "2014-01-07T06:52:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [January 7, 2014, 6:52am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120/1 "2014-01-07T06:52:35Z")

</div>

Dear all,

I cannot able to query the field of attachment type. I followed the  
instruction  
in [http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html](http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html).

And the result of the search query:

curl "[http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true)" -d '{  
"fields" : ["title"],  
"query" : {  
"query\_string" : {  
"query" : "amplifier"  
}  
},  
"highlight" : {  
"fields" : {  
"file" : {}  
}  
}  
}'

result:

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

My ElasticSearch is the latest version, elasticsearch-0.90.9 and the plugin of mapper-attachment is 1.9.0 ([https://github.com/elasticsearch/elasticsearch-mapper-attachments](https://github.com/elasticsearch/elasticsearch-mapper-attachments)).

In fact, the environment finished the setup yesterday. I have no clue why it cannot find anything.

Any ideas?

Regards,

Ivan

--  
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/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.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:** [January 7, 2014, 7:08am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120/2 "2014-01-07T07:08:49Z")

</div>

Hard to say. Not enough details about what you did.  
Could you gist a curl recreation and also add in it the result of a \_search?q=\*&pretty

Did you restart elasticsearch after plugin installation?

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

Le 7 janv. 2014 à 07:52, HongXuan Ji [hxuanji@gmail.com](mailto:hxuanji@gmail.com) a écrit :

Dear all,

I cannot able to query the field of attachment type. I followed the instruction in [http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html](http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html).

And the result of the search query:

curl "[http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true)" -d '{  
"fields" : ["title"],  
"query" : {  
"query\_string" : {  
"query" : "amplifier"  
}  
},  
"highlight" : {  
"fields" : {  
"file" : {}  
}  
}  
}'

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

My ElasticSearch is the latest version, elasticsearch-0.90.9 and the plugin of mapper-attachment is 1.9.0 ([https://github.com/elasticsearch/elasticsearch-mapper-attachments](https://github.com/elasticsearch/elasticsearch-mapper-attachments)).  
In fact, the environment finished the setup yesterday. I have no clue why it cannot find anything.

Any ideas?

Regards,

## Ivan

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/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/748BDAC4-08DA-4BCD-8764-A03E637758A6%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/748BDAC4-08DA-4BCD-8764-A03E637758A6%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [January 7, 2014, 8:15am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120/3 "2014-01-07T08:15:58Z")

</div>

Hi, David,

This is the result of \_search?q=\*&pretty:

{  
"took": 0,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 1,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "test",  
"\_type": "attachment",  
"\_id": "9wsReuxrSzCC0qrRHsYYPg",  
"\_score": 1,  
"\_source": {  
"file":  
"PGh0bWw+VGhpcyBwYWdlIG1vdmVkIHRvIDxhIGhyZWY9Ig0KL2NvbnRlbnQvZGFtL0ludGVyc2lsL2RvY3VtZW50cy9mbjY3L2ZuNjc0Mi5wZGYNCg==Ij5oZXJlPC9hPjwvaHRtbD4NCg=="  
}  
}  
]  
}  
}

BTW, I did restart the ES after the plugin installed.

Ideas?

Thanks, a lot.

David Pilato於 2014年1月7日星期二UTC+8下午3時08分49秒寫道：

> Hard to say. Not enough details about what you did.  
> Could you gist a curl recreation and also add in it the result of a  
> \_search?q=\*&pretty
> 
> Did you restart elasticsearch after plugin installation?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 7 janv. 2014 à 07:52, HongXuan Ji \<[hxu...@gmail.com](mailto:hxu...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Dear all,
> 
> I cannot able to query the field of attachment type. I followed the  
> instruction in  
> [http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html](http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html)  
> .
> 
> And the result of the search query:
> 
> curl "[http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true)" -d '{  
> "fields" : ["title"],  
> "query" : {  
> "query\_string" : {  
> "query" : "amplifier"  
> }  
> },  
> "highlight" : {  
> "fields" : {  
> "file" : {}  
> }  
> }  
> }'
> 
> result:
> 
> {  
> "took" : 1,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 1,  
> "successful" : 1,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 0,  
> "max\_score" : null,  
> "hits" :   
> }  
> }
> 
> My Elasticsearch is the latest version, elasticsearch-0.90.9 and the plugin of mapper-attachment is 1.9.0 ([GitHub - elastic/elasticsearch-mapper-attachments: Mapper Attachments Type plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-mapper-attachments)).
> 
> In fact, the environment finished the setup yesterday. I have no clue why it cannot find anything.
> 
> Any ideas?
> 
> Regards,
> 
> Ivan
> 
> --  
> 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/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fa4c12da-c9d4-427f-abc1-299692886046%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fa4c12da-c9d4-427f-abc1-299692886046%40googlegroups.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:** [January 7, 2014, 9:00am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120/4 "2014-01-07T09:00:25Z")

</div>

I used [http://www.base64decode.org/](http://www.base64decode.org/) to look at your indexed document.

Result is: "This page moved to \<a href="  
/content/dam/Intersil/documents/fn67/fn6742.pdf  
#W&S FР"

I guess you now have the explanation! 🙂

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

Le 7 janvier 2014 at 09:16:03, HongXuan Ji ([hxuanji@gmail.com](mailto:hxuanji@gmail.com)) a écrit:

Hi, David,

This is the result of \_search?q=\*&pretty:

{  
"took": 0,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"hits": {  
"total": 1,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "test",  
"\_type": "attachment",  
"\_id": "9wsReuxrSzCC0qrRHsYYPg",  
"\_score": 1,  
"\_source": {  
"file": "PGh0bWw+VGhpcyBwYWdlIG1vdmVkIHRvIDxhIGhyZWY9Ig0KL2NvbnRlbnQvZGFtL0ludGVyc2lsL2RvY3VtZW50cy9mbjY3L2ZuNjc0Mi5wZGYNCg==Ij5oZXJlPC9hPjwvaHRtbD4NCg=="  
}  
}  
]  
}  
}

BTW, I did restart the ES after the plugin installed.

Ideas?

Thanks, a lot.

David Pilato於 2014年1月7日星期二UTC+8下午3時08分49秒寫道：  
Hard to say. Not enough details about what you did.  
Could you gist a curl recreation and also add in it the result of a \_search?q=\*&pretty

Did you restart elasticsearch after plugin installation?

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

Le 7 janv. 2014 à 07:52, HongXuan Ji [hxu...@gmail.com](mailto:hxu...@gmail.com) a écrit :

Dear all,

I cannot able to query the field of attachment type. I followed the instruction in [http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html](http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html).

And the result of the search query:

curl "[http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true)" -d '{  
"fields" : ["title"],  
"query" : {  
"query\_string" : {  
"query" : "amplifier"  
}  
},  
"highlight" : {  
"fields" : {  
"file" : {}  
}  
}  
}'

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

My ElasticSearch is the latest version, elasticsearch-0.90.9 and the plugin of mapper-attachment is 1.9.0 ([https://github.com/elasticsearch/elasticsearch-mapper-attachments](https://github.com/elasticsearch/elasticsearch-mapper-attachments)).  
In fact, the environment finished the setup yesterday. I have no clue why it cannot find anything.

Any ideas?

Regards,

## Ivan

## 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/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fa4c12da-c9d4-427f-abc1-299692886046%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fa4c12da-c9d4-427f-abc1-299692886046%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.52cbc22a.32fff902.11bb1%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52cbc22a.32fff902.11bb1%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [January 7, 2014, 9:13am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120/5 "2014-01-07T09:13:27Z")

</div>

OH!  
It's so embarrassed. Anyway, thanks for the tip.

Best,

Ivan

David Pilato於 2014年1月7日星期二UTC+8下午5時00分25秒寫道：

> I used [http://www.base64decode.org/](http://www.base64decode.org/) to look at your indexed document.
> 
> Result is: "_This page moved to \<a href="_  
> _/content/dam/Intersil/documents/fn67/fn6742.pdf_
> 
> - #W&S FР\*"
> 
> I guess you now have the explanation! 🙂
> 
> --  
> _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)
> 
> Le 7 janvier 2014 at 09:16:03, HongXuan Ji ([hxu...@gmail.com](mailto:hxu...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Hi, David,
> 
> This is the result of \_search?q=\*&pretty:
> 
> {  
> "took": 0,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 1,  
> "successful": 1,  
> "failed": 0  
> },  
> "hits": {  
> "total": 1,  
> "max\_score": 1,  
> "hits": [  
> {  
> "\_index": "test",  
> "\_type": "attachment",  
> "\_id": "9wsReuxrSzCC0qrRHsYYPg",  
> "\_score": 1,  
> "\_source": {  
> "file":  
> "PGh0bWw+VGhpcyBwYWdlIG1vdmVkIHRvIDxhIGhyZWY9Ig0KL2NvbnRlbnQvZGFtL0ludGVyc2lsL2RvY3VtZW50cy9mbjY3L2ZuNjc0Mi5wZGYNCg==Ij5oZXJlPC9hPjwvaHRtbD4NCg=="  
> }  
> }  
> ]  
> }  
> }
> 
> BTW, I did restart the ES after the plugin installed.
> 
> Ideas?
> 
> Thanks, a lot.
> 
> David Pilato於 2014年1月7日星期二UTC+8下午3時08分49秒寫道：
> 
> > Hard to say. Not enough details about what you did.  
> > Could you gist a curl recreation and also add in it the result of a  
> > \_search?q=\*&pretty
> > 
> > Did you restart elasticsearch after plugin installation?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 7 janv. 2014 à 07:52, HongXuan Ji [hxu...@gmail.com](mailto:hxu...@gmail.com) a écrit :
> > 
> > Dear all,
> > 
> > I cannot able to query the field of attachment type. I followed the  
> > instruction in  
> > [http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html](http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html)  
> > .
> > 
> > And the result of the search query:
> > 
> > curl "[http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true)" -d '{  
> > "fields" : ["title"],  
> > "query" : {  
> > "query\_string" : {  
> > "query" : "amplifier"  
> > }  
> > },  
> > "highlight" : {  
> > "fields" : {  
> > "file" : {}  
> > }  
> > }  
> > }'
> > 
> > result:
> > 
> > {  
> > "took" : 1,  
> > "timed\_out" : false,  
> > "\_shards" : {  
> > "total" : 1,  
> > "successful" : 1,  
> > "failed" : 0  
> > },  
> > "hits" : {  
> > "total" : 0,  
> > "max\_score" : null,  
> > "hits" :   
> > }  
> > }
> > 
> > My Elasticsearch is the latest version, elasticsearch-0.90.9 and the plugin of mapper-attachment is 1.9.0 ([GitHub - elastic/elasticsearch-mapper-attachments: Mapper Attachments Type plugin for Elasticsearch](https://github.com/elasticsearch/elasticsearch-mapper-attachments)).
> > 
> > In fact, the environment finished the setup yesterday. I have no clue why it cannot find anything.
> > 
> > Any ideas?
> > 
> > Regards,
> > 
> > Ivan
> > 
> > --  
> > 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/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0768325-af0d-4aeb-ae2d-499fac1ca08a%40googlegroups.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:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/fa4c12da-c9d4-427f-abc1-299692886046%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fa4c12da-c9d4-427f-abc1-299692886046%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d8b21d4f-393e-4267-8fd3-40617c40b708%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d8b21d4f-393e-4267-8fd3-40617c40b708%40googlegroups.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, 1:58am UTC](https://discuss.elastic.co/t/cannot-search-the-field-of-the-attachment-type/15120/6 "2017-07-06T01:58:05Z")

</div>


