I'm uploading attachments to be parsed in ES using Java api. I have ES 
1.2.2 with proper elasticsearch-mapper-attachments/ plugin installed. Code 
works fine and I can search by attachment content but  ...

1. File content is stored into elastic search. Is there a way how to avoid 
this? Just to index the content but not store?

I have this mapping code (not full code):

XContentBuilder map = jsonBuilder().startObject()
        .startObject(idxType)
          .startObject("properties")
            .startObject("file")
              .field("type", "attachment")
              .field("store","no")
            .endObject()
          .endObject()
     .endObject();

    and indexing by using this:

BytesReference json = jsonBuilder()
                .startObject()
                    .field("_id", filePath)
                     .field("file", data64)
                .endObject().bytes();
        
IndexResponse idxResp = client.prepareIndex().setIndex(idxName).setType(
idxType).setId(filePath)

2)  I cant see file metadata created as described in docs. I understand 
that they are (should be) created automaticly ?

Docs says these fields should appear ...

 "fields" : {
                    "file" : {"index" : "no"},
                    "title" : {"store" : "yes"},
                    "date" : {"store" : "yes"},
                    "author" : {"analyzer" : "myAnalyzer"},
                    "keywords" : {"store" : "yes"},
                    "content_type" : {"store" : "yes"},
                    "content_length" : {"store" : "yes"},
                    "language" : {"store" : "yes"}
   }

-- 
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/5a29d66f-99d8-48e4-b93c-7caf61b93214%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to