# Attachment arabic

**URL:** <https://discuss.elastic.co/t/attachment-arabic/12621>\
**Category:** Elasticsearch\
**Created:** [July 2, 2013, 3:59pm UTC](https://discuss.elastic.co/t/attachment-arabic/12621 "2013-07-02T15:59:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghonsor](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@ghonsor](https://discuss.elastic.co/u/ghonsor)\
**Post date:** [July 2, 2013, 3:59pm UTC](https://discuss.elastic.co/t/attachment-arabic/12621/1 "2013-07-02T15:59:19Z")

</div>

Hi all

In ES with mapper-attachment do we can index arabic pdf and search on it?

can you give me one example?(like java exapmle or with curl)

I test this mapping:

curl -XPUT '[http://localhost:9200/test/arabic/\_mapping](http://localhost:9200/test/arabic/_mapping)' -d '  
{  
"arabic" : {  
"properties" : {  
"content" : {"type" : "attachment", "analyzer" : "arabic" }  
}  
}  
}  
'

but I can't query on indexed pdf

thanks

--  
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:** [July 2, 2013, 4:36pm UTC](https://discuss.elastic.co/t/attachment-arabic/12621/2 "2013-07-02T16:36:25Z")

</div>

Could you GIST a full curl recreation of what you did so far?  
How do you index your document? How do you search in it?

Note that you should probably use that kind of mapping:

{  
"person" : {  
"properties" : {  
"file" : {  
"type" : "attachment",  
"fields" : {  
"file" : { "analyzer" : "arabic" },  
"date" : { "store" : "yes" },  
"author" : { "analyzer" : "arabic" }  
}  
}  
}  
}  
}  
My 2 cents

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

Le 2 juil. 2013 à 17:59, ghonsor [sajad22@gmail.com](mailto:sajad22@gmail.com) a écrit :

> Hi all
> 
> In ES with mapper-attachment do we can index arabic pdf and search on it?
> 
> can you give me one example?(like java exapmle or with curl)
> 
> I test this mapping:
> 
> curl -XPUT '[http://localhost:9200/test/arabic/\_mapping](http://localhost:9200/test/arabic/_mapping)' -d '  
> {  
> "arabic" : {  
> "properties" : {  
> "content" : {"type" : "attachment", "analyzer" : "arabic" }  
> }  
> }  
> }  
> '
> 
> but I can't query on indexed pdf
> 
> thanks
> 
> --  
> 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:** ![ghonsor](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@ghonsor](https://discuss.elastic.co/u/ghonsor)\
**Post date:** [July 3, 2013, 11:28am UTC](https://discuss.elastic.co/t/attachment-arabic/12621/3 "2013-07-03T11:28:48Z")

</div>

Hi David

I use this mapping:  
curl -XPUT '[http://localhost:9200/david/person/\_mapping](http://localhost:9200/david/person/_mapping)' -d '  
{  
"person" : {  
"properties" : {  
"file" : {  
"type" : "attachment",  
"fields" : {  
"file" : { "analyzer" : "arabic" },  
"date" : { "store" : "yes" },  
"author" : { "analyzer" : "arabic" }  
}  
}  
}  
}  
}'

and make json from document using this script:

coded=`cat $1.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`  
json="{"file":"${coded}"}"  
echo "$json" \> json.file

and indexing using this:

curl -XPUT localhost:9200/david/person/0 -d @json.file

and search with this from browser:

[http://localhost:9200/david/person/\_search?q=file:محمود&pretty=true](http://localhost:9200/david/person/_search?q=file:%D9%85%D8%AD%D9%85%D9%88%D8%AF&pretty=true)

but the total number of hits is zero

can you help me?

On Tuesday, July 2, 2013 9:06:25 PM UTC+4:30, David Pilato wrote:

> Could you GIST a full curl recreation of what you did so far?  
> How do you index your document? How do you search in it?
> 
> Note that you should probably use that kind of mapping:
> 
> {  
> "person" : {  
> "properties" : {  
> "file" : {  
> "type" : "attachment",  
> "fields" : {  
> "file" : { "analyzer" : "arabic" },  
> "date" : { "store" : "yes" },  
> "author" : { "analyzer" : "arabic" }  
> }  
> }  
> }  
> }  
> }
> 
> My 2 cents
> 
> --  
> _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 2 juil. 2013 à 17:59, ghonsor \<[saj...@gmail.com](mailto:saj...@gmail.com) \<javascript:\>\> a écrit  
> :
> 
> Hi all
> 
> In ES with mapper-attachment do we can index arabic pdf and search on it?
> 
> can you give me one example?(like java exapmle or with curl)
> 
> I test this mapping:
> 
> curl -XPUT '[http://localhost:9200/test/arabic/\_mapping](http://localhost:9200/test/arabic/_mapping)' -d '  
> {  
> "arabic" : {  
> "properties" : {  
> "content" : {"type" : "attachment", "analyzer" : "arabic" }  
> }  
> }  
> }  
> '
> 
> but I can't query on indexed pdf
> 
> thanks
> 
> --  
> 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:** [July 3, 2013, 9:15pm UTC](https://discuss.elastic.co/t/attachment-arabic/12621/4 "2013-07-03T21:15:47Z")

</div>

Could you use the \_analyze API to see how your extracted text is broken into tokens using arabic analyzer?

Something like:

curl -XGET 'localhost:9200/\_analyze?analyzer=arabic' -d 'your text here'  
It could give you clues

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

Le 3 juil. 2013 à 13:28, ghonsor [sajad22@gmail.com](mailto:sajad22@gmail.com) a écrit :

> Hi David
> 
> I use this mapping:  
> curl -XPUT '[http://localhost:9200/david/person/\_mapping](http://localhost:9200/david/person/_mapping)' -d '  
> {  
> "person" : {  
> "properties" : {  
> "file" : {  
> "type" : "attachment",  
> "fields" : {  
> "file" : { "analyzer" : "arabic" },  
> "date" : { "store" : "yes" },  
> "author" : { "analyzer" : "arabic" }  
> }  
> }  
> }  
> }  
> }'
> 
> and make json from document using this script:
> 
> coded=`cat $1.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`  
> json="{"file":"${coded}"}"  
> echo "$json" \> json.file
> 
> and indexing using this:
> 
> curl -XPUT localhost:9200/david/person/0 -d @json.file
> 
> and search with this from browser:
> 
> [http://localhost:9200/david/person/\_search?q=file:محمود&pretty=true](http://localhost:9200/david/person/_search?q=file:%D9%85%D8%AD%D9%85%D9%88%D8%AF&pretty=true)
> 
> but the total number of hits is zero
> 
> can you help me?
> 
> On Tuesday, July 2, 2013 9:06:25 PM UTC+4:30, David Pilato wrote:  
> Could you GIST a full curl recreation of what you did so far?  
> How do you index your document? How do you search in it?
> 
> Note that you should probably use that kind of mapping:
> 
> {  
> "person" : {  
> "properties" : {  
> "file" : {  
> "type" : "attachment",  
> "fields" : {  
> "file" : { "analyzer" : "arabic" },  
> "date" : { "store" : "yes" },  
> "author" : { "analyzer" : "arabic" }  
> }  
> }  
> }  
> }  
> }  
> My 2 cents
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr | @scrutmydocs
> 
> Le 2 juil. 2013 à 17:59, ghonsor [saj...@gmail.com](mailto:saj...@gmail.com) a écrit :
> 
> > Hi all
> > 
> > In ES with mapper-attachment do we can index arabic pdf and search on it?
> > 
> > can you give me one example?(like java exapmle or with curl)
> > 
> > I test this mapping:
> > 
> > curl -XPUT '[http://localhost:9200/test/arabic/\_mapping](http://localhost:9200/test/arabic/_mapping)' -d '  
> > {  
> > "arabic" : {  
> > "properties" : {  
> > "content" : {"type" : "attachment", "analyzer" : "arabic" }  
> > }  
> > }  
> > }  
> > '
> > 
> > but I can't query on indexed pdf
> > 
> > thanks
> > 
> > --  
> > 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).

---

<div class="post-metadata">

**Author:** ![ghonsor](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@ghonsor](https://discuss.elastic.co/u/ghonsor)\
**Post date:** [July 6, 2013, 10:10am UTC](https://discuss.elastic.co/t/attachment-arabic/12621/5 "2013-07-06T10:10:32Z")

</div>

I test it, but it can't found any query

Is mapper attachment support arabic pdf?( unless without arabic analyzer )

On Thursday, July 4, 2013 1:45:47 AM UTC+4:30, David Pilato wrote:

> Could you use the \_analyze API to see how your extracted text is broken  
> into tokens using arabic analyzer?
> 
> Something like:
> 
> curl -XGET 'localhost:9200/\_analyze?analyzer=arabic' -d 'your text here'
> 
> It could give you clues
> 
> --  
> _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 3 juil. 2013 à 13:28, ghonsor \<[saj...@gmail.com](mailto:saj...@gmail.com) \<javascript:\>\> a écrit  
> :
> 
> Hi David
> 
> I use this mapping:  
> curl -XPUT '[http://localhost:9200/david/person/\_mapping](http://localhost:9200/david/person/_mapping)' -d '  
> {  
> "person" : {  
> "properties" : {  
> "file" : {  
> "type" : "attachment",  
> "fields" : {  
> "file" : { "analyzer" : "arabic" },  
> "date" : { "store" : "yes" },  
> "author" : { "analyzer" : "arabic" }  
> }  
> }  
> }  
> }  
> }'
> 
> and make json from document using this script:
> 
> coded=`cat $1.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`  
> json="{"file":"${coded}"}"  
> echo "$json" \> json.file
> 
> and indexing using this:
> 
> curl -XPUT localhost:9200/david/person/0 -d @json.file
> 
> and search with this from browser:
> 
> [http://localhost:9200/david/person/\_search?q=file:محمود&pretty=true](http://localhost:9200/david/person/_search?q=file:%D9%85%D8%AD%D9%85%D9%88%D8%AF&pretty=true)
> 
> but the total number of hits is zero
> 
> can you help me?
> 
> On Tuesday, July 2, 2013 9:06:25 PM UTC+4:30, David Pilato wrote:
> 
> > Could you GIST a full curl recreation of what you did so far?  
> > How do you index your document? How do you search in it?
> > 
> > Note that you should probably use that kind of mapping:
> > 
> > {  
> > "person" : {  
> > "properties" : {  
> > "file" : {  
> > "type" : "attachment",  
> > "fields" : {  
> > "file" : { "analyzer" : "arabic" },  
> > "date" : { "store" : "yes" },  
> > "author" : { "analyzer" : "arabic" }  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > My 2 cents
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | \*[Elasticsearch.com](http://Elasticsearch.com)[http://elasticsearch.com/](http://elasticsearch.com/)  
> > \*  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 2 juil. 2013 à 17:59, ghonsor [saj...@gmail.com](mailto:saj...@gmail.com) a écrit :
> > 
> > Hi all
> > 
> > In ES with mapper-attachment do we can index arabic pdf and search on it?
> > 
> > can you give me one example?(like java exapmle or with curl)
> > 
> > I test this mapping:
> > 
> > curl -XPUT '[http://localhost:9200/test/arabic/\_mapping](http://localhost:9200/test/arabic/_mapping)' -d '  
> > {  
> > "arabic" : {  
> > "properties" : {  
> > "content" : {"type" : "attachment", "analyzer" : "arabic" }  
> > }  
> > }  
> > }  
> > '
> > 
> > but I can't query on indexed pdf
> > 
> > thanks
> > 
> > --  
> > 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:27am UTC](https://discuss.elastic.co/t/attachment-arabic/12621/6 "2017-07-06T02:27:51Z")

</div>


