Sounds like it's not correct.

You have 2 attachments and the one you actualy use does not store file.

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 22 mars 2014 à 14:36, sAs59 <[email protected]> a écrit :
> 
> http://localhost:9200/mongoindex/files/_mapping?pretty=true  
> "mongoindex" : {
>     "mappings" : {
>       "files" : {
>         "properties" : {
>           "chunkSize" : {
>             "type" : "long"
>           },
>           "content" : {
>             "type" : "attachment",
>             "path" : "full",
>             "fields" : {
>               "content" : {
>                 "type" : "string"
>               },
>               "author" : {
>                 "type" : "string"
>               },
>               "title" : {
>                 "type" : "string"
>               },
>               "name" : {
>                 "type" : "string"
>               },
>               "date" : {
>                 "type" : "date",
>                 "format" : "dateOptionalTime"
>               },
>               "keywords" : {
>                 "type" : "string"
>               },
>               "content_type" : {
>                 "type" : "string"
>               },
>               "content_length" : {
>                 "type" : "integer"
>               }
>             }
>           },
>           "contentType" : {
>             "type" : "string"
>           },
>           "file" : {
>             "type" : "attachment",
>             "path" : "full",
>             "fields" : {
>               "file" : {
>                 "type" : "string",
>                 "index" : "no",
>                 "store" : true
>               },
>               "author" : {
>                 "type" : "string"
>               },
>               "title" : {
>                 "type" : "string"
>               },
>               "name" : {
>                 "type" : "string"
>               },
>               "date" : {
>                 "type" : "date",
>                 "format" : "dateOptionalTime"
>               },
>               "keywords" : {
>                 "type" : "string"
>               },
>               "content_type" : {
>                 "type" : "string"
>               },
>               "content_length" : {
>                 "type" : "integer"
>               }
>             }
>           },
>           "filename" : {
>             "type" : "string"
>           },
>           "length" : {
>             "type" : "long"
>           },
>           "md5" : {
>             "type" : "string"
>           },
>           "metadata" : {
>             "type" : "object"
>           },
>           "uploadDate" : {
>             "type" : "date",
>             "format" : "dateOptionalTime"
>           }
>         }
>       }
>     }
>   }
> }
> 
> 
>> On Sat, Mar 22, 2014 at 7:33 PM, dadoonet [via ElasticSearch Users] <[hidden 
>> email]> wrote:
>> Could you paste your mapping?
>> 
>> http://localhost:9200/mongoindex/files/_mapping?pretty
>> 
>> --
>> David ;-)
>> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>> 
>> 
>> Le 22 mars 2014 à 14:15, sAs59 <[hidden email]> a écrit :
>> 
>> Hi,
>> I followed your instructions and it seems work.
>> In my files collection I have two files which contains word "akmurat"
>> And when I search using following command:
>> http://localhost:9200/mongoindex/files/_search?q=akmurat&fields=file.file&pretty=true
>> I got:
>> {
>>   "took" : 11,
>>   "timed_out" : false,
>>   "_shards" : {
>>     "total" : 5,
>>     "successful" : 5,
>>     "failed" : 0
>>   },
>>   "hits" : {
>>     "total" : 2,
>>     "max_score" : 0.081366636,
>>     "hits" : [ {
>>       "_index" : "mongoindex",
>>       "_type" : "files",
>>       "_id" : "532d89c4119bcc028e8001da",
>>       "_score" : 0.081366636
>>     }, {
>>       "_index" : "mongoindex",
>>       "_type" : "files",
>>       "_id" : "532d89b94f7399ab6975977a",
>>       "_score" : 0.057534903
>>     } ]
>>   }
>> }
>> It returns files ID and its good.
>> Is there a way showing my files content in a readable form
>> Usually it returns:
>> {
>>   "_index" : "mongoindex",
>>   "_type" : "files",
>>   "_id" : "532d89b94f7399ab6975977a",
>>   "_version" : 1,
>>   "found" : true, "_source" : 
>> {"content":{"content_type":null,"title":"D:/text.txt","content":"TXkgbmFtZSBpcyBBa211cmF0IFNha3RhZ2FuLiBJIGFtIDIxIHllYXJzIG9sZC4="},"filename":"D:/text.txt","contentType":null,"md5":"c8f86639cb4bfec23deab7beea473683","length":47,"chunkSize":262144,"uploadDate":"2014-03-22T13:01:45.258Z","metadata":{}}
>> }
>> I want:
>> {
>>   "_index" : "mongoindex",
>>   "_type" : "files",
>>   "_id" : "532d89b94f7399ab6975977a",
>>   "_version" : 1,
>>   "found" : true, "_source" : 
>> {"content":{"content_type":null,"title":"D:/text.txt","content":"My name is 
>> Akmurat Saktagan. I am 21 years 
>> old."},"filename":"D:/text.txt","contentType":null,"md5":"c8f86639cb4bfec23deab7beea473683","length":47,"chunkSize":262144,"uploadDate":"2014-03-22T13:01:45.258Z","metadata":{}}
>> 
>> 
>> }
>> Thank you!
>> 
>> 
>> 
>> 
>>> On Thu, Mar 20, 2014 at 3:45 PM, dadoonet [via ElasticSearch Users] 
>>> <[hidden email]> wrote:
>>> I think I'm starting to understand what you are trying to get…
>>> You don't want original content but only extracted content, right?
>>> 
>>> I think that if you store content it should work.
>>> 
>>> Something like this (in mapping):
>>> 
>>> {
>>>     "person" : {
>>>         "properties" : {
>>>             "file" : {
>>>                 "type" : "attachment",
>>>                 "fields" : {
>>>                     "file" : {"index" : "no", "store" : "yes"}
>>>                 }
>>>             }
>>>         }
>>>     }
>>> }
>>> 
>>> And then when search, ask for field "file.file" instead of _source 
>>> (default): 
>>> curl -XGET 
>>> 'http://localhost:9200/index/person/_search?q=whatever&fields=file.file'
>>> 
>>> Should work I guess.
>>> 
>>> -- 
>>> David Pilato | Technical Advocate | Elasticsearch.com
>>> @dadoonet | @elasticsearchfr
>>> 
>>> 
>>>> Le 20 mars 2014 à 10:12:01, sAs59 ([hidden email]) a écrit:
>>>> 
>>>> It's still unclear, I've decoded my whole text and instead I'm getting 
>>>> this kind of text.
>>>> Where should I see my actual text?
>>>> I also tried using different charset, but still unclear.
>>>> 
>>>> <</Filter/FlateDecode/Length 1549>>
>>>> stream
>>>> xœ­XKoÛF ¾ ð Б â –\.Ék€8MÑ^
>>>> ÷ $=Ð % –-—”ìôßwfvgw–‘" ( 8Ü÷7¯ofôáîúêý­ži£æfv·º¾Ò³9üÓ³¦R ¦êºP• 
>>>> Ý=]_Ígküóéúêkv—›ì!¿)³~–ßh“½Áx‡ã!o²-~,ñ ,VÙ ¿Æ0\À9“u°ï ­q~ að o,² 'ø xa èEw 
>>>> >Ö°Á ¤ ßÿB06 !ØÓv„3c¼xµC< ,í‘b-aÜ¿âzOrù;_àã)o³þ —öñ.Z]ÑU#o^ 
>>>> ”ž6ý“ë2SN¾?avd8³ü¯Ùݯ×W Á î~4BUªÖ ¾Æ7J[EùWp‹“÷)×uÖí ^áÏŽ·Ð C2ö`„ÒÍâr l 
>>>> PúÍÝbÑoQ«ˆrèèìˆBãz% ¶aqüATÑ@šEÃõ#/+Z/²Ïh^¯ú ±9 Ø›±wï/ù}ëÜH>Û] ̲RÆze. 
>>>> Ú’@ì‚çz—au¼;q§®
>>>> U¦Wžz^WVÙ"ÝÛ‘ …P©£§ŽqΩqËn 3Rj ºÿ.•E¼Dj^}—×Ñ GŽÂª¢¸ ö• ’H ñ+Œ;Úp@ 
>>>> ¹ÉàªôÞ…žjÎ P[Õ6^ƒKFMaß;Ò ®¨Ý[Ïqœ §1¿Ox¼^L` 3 ”³$t8•Ü ã Iå ÞO^_¹oTÁ^’¡G3 
>>>> c“éà}Á) +µàZrn|mÍ!A׿åÆãatáÕ€ŒÅ#59C~÷ü™x Jë ò¬!lÛ¨’
>>>> Ñå7 p¼ «‘u d PÕæ¿ WíµÓ= 3 Õ&5 Œÿ†ñ!qå½—sÇ ÜF‰fÅ hùC:r Gÿ wìqÄs,B ’”Ì1 ä. 
>>>> ‘U)âŒÜ´ñf<§õºU-+ ¡M1I^¥WÃ(g‚Ì8p¼Š’ ©' | G¡KÕ´)Ž-ç@¾·wª0ç’ œ= ~“¤?\Þ 
>>>> ?ÀñVÚ’.ë ÿô¤h8¢ G’£pÌT/p&PÊ+ $‰_ Äy[Y­Lá•4:MxŸßsäv b³Ö;‰ i+”¡# †à@à?Nm" 
>>>> DN¿ ª ]l™}„ñw6û(} ­«|‚ »E’ëéz ÔU_¤äWVÖÒg k½7v  ˆ§þ¿ä`M K¥‘ R$>è¼Ùm#Ì^O2 
>>>> NÐÎΑrØÃ*pé†jÕ:I“ ^ý §E Þ‰6å ][BI·cÌô Y–*E †[HéAÔÝMùœÁœ· >8 – ¤åWºñ 5 
>>>> F•¬æ/¹‘•Fy jëì ‡ô>" h¥É>!È i J¿L÷>ȨÀù–kËÄÃŽ£-‹Bé*EK†™Ï…ÏáUGü-f x3TG©ï¶Z 
>>>> '~ cÒ U®Ý=w>i­åö f8§úy¥šÒ óH ± Ñ‚- Zˆ À0pÖy‘ µLI IÊ Kú!÷þßqGõ V 
>>>> ½X¦üþÛO\§,¬2uŠÿæÔÞR“áäÞ“÷–FÕ“½$`· í
>>>> zT™šÆBÞ‰% J²C*hB)Õû>.a +IöHûr9SUM­ÊÊãý–u‡¼Œ‰x'â'åÑ Ïøà“ÜCsÂk[O#,åà] :€ 
>>>> ðµt_[DþqÁì¶^fÚªEÝ'" 4­5ªÒéÞ“÷ÚV™É½lZW šì[î¥YzÑq~
>>>> ½"É Ëˆ ÐCHóƒŒÆ6):` uu>@+Û ?:´Ÿ}9 ¤þ îCoPÎÁ ï„è ÅâÁ»Q·d ± î¹j£ ¡h|“`Ò 
>>>> [€þ"%;²ÇÁ…ÐÌ—“ž "Ð ˆ£ä " Ý*= ù•I Ñ/ø®Ø ÁÓÄSo! ! … ý\íÕ\ õ´-tÆÝú$òÂi®¨D¯B 
>>>> ˜.lÖ¯ _lüéçH âP eÇa9Š=±†Á M ¹‰æ¥ŽïÀ¿ŒˆjK ÅEY¼ - ¾ƒ:‡ÎbÌ£ àôžIÉŸYF7 
>>>> ?®ÐÌ}îÊð}ô±ó< T]s#àlê\m—ûò1h²÷MrlLf¹Ö'ÊÖæØOBj‚åým1ÓzúÛeQ¶jަȤ ÿ òˆ©
>>>> endstream
>>>> endobj
>>>> 5 0 obj
>>>> <</Type/Font/Subtype/TrueType/Name/F1/BaseFont/Times#20New#20Roman/Encoding/WinA
>>>> 
>>>> View this message in context: Re: searching pdf files by content with 
>>>> Mongodb-river
>>>> 
>>>> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
>>>> --
>>>> 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 [hidden email].
>>>> To view this discussion on the web visit  
>>>> https://groups.google.com/d/msgid/elasticsearch/CA%2B5_B1CzWZCxFbYL_akVm%2B%2Bjh%2BwQj-NXsAgedTsp3sLbUtNpKw%40mail.gmail.com.
>>>> 
>>>> For more options, visit https://groups.google.com/d/optout.
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "elasticsearch" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [hidden email].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elasticsearch/etPan.532ab87c.9daf632.97ca%40MacBook-Air-de-David.local.
>>> 
>>> For more options, visit https://groups.google.com/d/optout.
>>> 
>>> 
>>> If you reply to this email, your message will be added to the discussion 
>>> below:
>>> http://elasticsearch-users.115913.n3.nabble.com/searching-pdf-files-by-content-with-Mongodb-river-tp4051989p4052339.html
>>> To unsubscribe from searching pdf files by content with Mongodb-river, 
>>> click here.
>>> NAML
>> 
>> 
>> View this message in context: Re: searching pdf files by content with 
>> Mongodb-river
>> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
>> -- 
>> 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 [hidden email].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/CA%2B5_B1D-EDGHk_kn5tzgU6CWU58hW29jdkd0sVdFhUv6Coppow%40mail.gmail.com.
>> 
>> For more options, visit https://groups.google.com/d/optout.
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [hidden email].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/85A4AC31-3459-4D92-84F2-027047022C4C%40pilato.fr.
>> 
>> For more options, visit https://groups.google.com/d/optout.
>> 
>> 
>> If you reply to this email, your message will be added to the discussion 
>> below:
>> http://elasticsearch-users.115913.n3.nabble.com/searching-pdf-files-by-content-with-Mongodb-river-tp4051989p4052548.html
>> To unsubscribe from searching pdf files by content with Mongodb-river, click 
>> here.
>> NAML
> 
> 
> View this message in context: Re: searching pdf files by content with 
> Mongodb-river
> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
> -- 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/CA%2B5_B1Ah6rpoM0ZTGUKrpb_yyBozA0s-_tQTRn7VEdAXPZ3wsw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/E6ABD9A4-1F09-4EA5-B8CA-100A5F31474A%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to