How to index an attachment with Java API

Hi,

I need to index a document with an attachment, using the Java API.

Is it the good method IndexRequestBuilder.setSource(byte[] source) ?
(Javadoc is'nt very verbose ...)

If yes, do i need to encode in base 64 ?

Is there an example somewhere ?

I read about SimpleAttachmentIntegrationTests but don't find it in the
source code (0.20.5) ...

Thx for help,
Yann.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey Yann,

Have a look here: https://github.com/scrutmydocs/scrutmydocs/blob/master/src/main/java/org/scrutmydocs/webapp/servlet/UploadServlet.java#L100

It should help.

Let me know if you need more explanation.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 févr. 2013 à 16:49, Yann Moisan yamo93@gmail.com a écrit :

Hi,

I need to index a document with an attachment, using the Java API.

Is it the good method IndexRequestBuilder.setSource(byte source) ? (Javadoc is'nt very verbose ...)

If yes, do i need to encode in base 64 ?

Is there an example somewhere ?

I read about SimpleAttachmentIntegrationTests but don't find it in the source code (0.20.5) ...

Thx for help,
Yann.

--
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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.