# How to search on attachment file names

**URL:** <https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015>\
**Category:** Elasticsearch\
**Created:** [March 15, 2012, 11:03am UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015 "2012-03-15T11:03:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alheim](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@alheim](https://discuss.elastic.co/u/alheim)\
**Post date:** [March 15, 2012, 11:03am UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/1 "2012-03-15T11:03:13Z")

</div>

There is a \_name attribute for attachments. Is there any way to query on it  
?

Thanks.

---

<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:** [March 15, 2012, 12:30pm UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/2 "2012-03-15T12:30:59Z")

</div>

If your attachment field is : my\_attachment  
Then, you should be able to query on my\_attachment.\_name

HTH  
David.

Le 15 mars 2012 à 12:03, Alexandre Heimburger [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) a  
écrit :

> attachments. Is there any way to query on it ?
> 
> Thanks.

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![alheim](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@alheim](https://discuss.elastic.co/u/alheim)\
**Post date:** [March 15, 2012, 1:36pm UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/3 "2012-03-15T13:36:52Z")

</div>

Hi David,

After looking at the code, \_name is just used for posting an attachment.  
It is not stored in the index.

I'm gonna prepare a pull request to add a field for the file name

On Thu, Mar 15, 2012 at 1:30 PM, [david@pilato.fr](mailto:david@pilato.fr) [david@pilato.fr](mailto:david@pilato.fr) wrote:

> \*\*
> 
> If your attachment field is : my\_attachment
> 
> Then, you should be able to query on my\_attachment.\_name
> 
> HTH  
> David.
> 
> Le 15 mars 2012 à 12:03, Alexandre Heimburger [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
> a écrit :
> 
> There is a \_name attribute for attachments. Is there any way to query on  
> it ?
> 
> Thanks.
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

## -- Alexandre Heimburger VP Engineering blueKiwi Software tel : +33687880997 email : [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) adress : 93 rue Vieille du Temple, 75003 Paris

blueKiwi is the innovation leader in Enterprise Social Software. Our  
solutions enable enterprises worldwide to engage and interact with their  
internal and external social networks in multiple business domains.  
blueKiwi has been consistently recognized by Gartner Inc. as a visionary  
provider since 2007.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 17, 2012, 9:51am UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/4 "2012-03-17T09:51:08Z")

</div>

Yes, the name is only used to allow to more easily predict (by Tika) the  
type of the content based on it. But its not indexed..., will have a look  
at the pull request.

On Thu, Mar 15, 2012 at 3:36 PM, Alexandre Heimburger \<  
[ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)\> wrote:

> Hi David,
> 
> After looking at the code, \_name is just used for posting an attachment.  
> It is not stored in the index.
> 
> I'm gonna prepare a pull request to add a field for the file name
> 
> On Thu, Mar 15, 2012 at 1:30 PM, [david@pilato.fr](mailto:david@pilato.fr) [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > \*\*
> > 
> > If your attachment field is : my\_attachment
> > 
> > Then, you should be able to query on my\_attachment.\_name
> > 
> > HTH  
> > David.
> > 
> > Le 15 mars 2012 à 12:03, Alexandre Heimburger [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
> > a écrit :
> > 
> > There is a \_name attribute for attachments. Is there any way to query  
> > on it ?
> > 
> > Thanks.
> > 
> > --  
> > David Pilato  
> > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > Twitter : @dadoonet
> 
> --  
> Alexandre Heimburger  
> VP Engineering  
> blueKiwi Software  
> tel : +33687880997  
> email : [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
> adress : 93 rue Vieille du Temple, 75003 Paris
> 
> * * *
> 
> blueKiwi is the innovation leader in Enterprise Social Software. Our  
> solutions enable enterprises worldwide to engage and interact with their  
> internal and external social networks in multiple business domains.  
> blueKiwi has been consistently recognized by Gartner Inc. as a visionary  
> provider since 2007.

---

<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:** [March 19, 2012, 8:07am UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/5 "2012-03-19T08:07:23Z")

</div>

Thanks Alexandre.

I thought it was working. Good to know.  
I understood know why we added a filename (not \_name) field in our document  
type as we could not search on it.

😉  
Cheers  
David.

Le 15 mars 2012 à 14:36, Alexandre Heimburger [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) a  
écrit :

> After looking at the code, \_name is just used for posting an attachment.  
> It is not stored in the index.
> 
> I'm gonna prepare a pull request to add a field for the file name
> 
> On Thu, Mar 15, 2012 at 1:30 PM, [david@pilato.fr](mailto:david@pilato.fr) [mailto:david@pilato.fr](mailto:david@pilato.fr)  
> \< [david@pilato.fr](mailto:david@pilato.fr) [mailto:david@pilato.fr](mailto:david@pilato.fr) \> wrote:
> 
> > If your attachment field is : my\_attachment  
> > Then, you should be able to query on my\_attachment.\_name
> > 
> > HTH  
> > David.
> > 
> > Le 15 mars 2012 à 12:03, Alexandre Heimburger \< [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
> > [mailto:ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) \> a écrit :
> > 
> > > attachments. Is there any way to query on it ?
> > > 
> > > Thanks.
> > 
> > --  
> > David Pilato  
> > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/) [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > Twitter : @dadoonet
> 
> ## -- Alexandre Heimburger VP Engineering blueKiwi Software tel : +33687880997 email : [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) [mailto:ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) adress : 93 rue Vieille du Temple, 75003 Paris
> 
> blueKiwi is the innovation leader in Enterprise Social Software. Our  
> solutions enable enterprises worldwide to engage and interact with their  
> internal and external social networks in multiple business domains.  
> blueKiwi has been consistently recognized by Gartner Inc. as a visionary  
> provider since 2007.

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![alheim](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@alheim](https://discuss.elastic.co/u/alheim)\
**Post date:** [March 19, 2012, 8:33am UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/6 "2012-03-19T08:33:38Z")

</div>

A patch for the attachment mapper has been pushed this week end.

A "name" field has been added and set with \_name attribute value.

On Mon, Mar 19, 2012 at 9:07 AM, [david@pilato.fr](mailto:david@pilato.fr) [david@pilato.fr](mailto:david@pilato.fr) wrote:

> \*\*
> 
> Thanks Alexandre.
> 
> I thought it was working. Good to know.
> 
> I understood know why we added a filename (not \_name) field in our  
> document type as we could not search on it.
> 
> 😉
> 
> Cheers
> 
> David.
> 
> Le 15 mars 2012 à 14:36, Alexandre Heimburger [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
> a écrit :
> 
> Hi David,
> 
> After looking at the code, \_name is just used for posting an attachment.  
> It is not stored in the index.
> 
> I'm gonna prepare a pull request to add a field for the file name
> 
> On Thu, Mar 15, 2012 at 1:30 PM, [david@pilato.fr](mailto:david@pilato.fr) \< [david@pilato.fr](mailto:david@pilato.fr) \> wrote:
> 
> If your attachment field is : my\_attachment
> 
> Then, you should be able to query on my\_attachment.\_name
> 
> HTH  
> David.
> 
> Le 15 mars 2012 à 12:03, Alexandre Heimburger \< [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)\> a écrit :
> 
> There is a \_name attribute for attachments. Is there any way to query on  
> it ?
> 
> Thanks.
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet
> 
> --  
> Alexandre Heimburger  
> VP Engineering  
> blueKiwi Software  
> tel : +33687880997  
> email : [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com)  
> adress : 93 rue Vieille du Temple, 75003 Paris
> 
> * * *
> 
> blueKiwi is the innovation leader in Enterprise Social Software. Our  
> solutions enable enterprises worldwide to engage and interact with their  
> internal and external social networks in multiple business domains.  
> blueKiwi has been consistently recognized by Gartner Inc. as a visionary  
> provider since 2007.
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

## -- Alexandre Heimburger VP Engineering blueKiwi Software tel : +33687880997 email : [ahb@bluekiwi-software.com](mailto:ahb@bluekiwi-software.com) adress : 93 rue Vieille du Temple, 75003 Paris

blueKiwi is the innovation leader in Enterprise Social Software. Our  
solutions enable enterprises worldwide to engage and interact with their  
internal and external social networks in multiple business domains.  
blueKiwi has been consistently recognized by Gartner Inc. as a visionary  
provider since 2007.

---

<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, 3:35am UTC](https://discuss.elastic.co/t/how-to-search-on-attachment-file-names/7015/7 "2017-07-06T03:35:38Z")

</div>


