Oh, the attachment part is for your PDF. If you don't need to index PDFs 
then just remove that part:

        PutMappingResponse putMappingResponse = new 
PutMappingRequestBuilder(
            client.admin().indices()).
setIndices(INDEX_NAME).setType(DOCUMENT_TYPE).setSource(
                XContentFactory.jsonBuilder().startObject()
                    .field(DOCUMENT_TYPE).startObject()
                        .field("properties").startObject()
                            .field("text").startObject()
                                .field("type", "string")
                            .endObject()
                        .endObject()
                    .endObject()
                .endObject()
        ).execute().actionGet();

Indexing:

        IndexResponse indexResponse = client.prepareIndex(INDEX_
NAME, DOCUMENT_TYPE, "1")
            .setSource(XContentFactory.jsonBuilder().startObject()
                .field("text", ocrText)
            .endObject()
        ).execute().actionGet();

-- 
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/cb733511-1f65-420c-ae78-e75c9866f2fa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to