I want to ask if the unique field _id be assigned by certain field within 
document. I see with Rest, it can achieve by "path":

    {
        "tweet" : {
            "_id" : {
               "path" : "post_id"
           }
        }
    }

But if I want to do it with java API, is there any way to achieve it?

    Map<String, Object> MapA= new HashMap<String, Object>();
    MapA=MapProcessor(MapA);

    client.prepareIndex("index","type").setSource(MapA).execute().actionGet();

How could I modify my code to assign certain field in Map to become _id of 
this type?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/3f9fe5df-cd96-4083-b21b-610dbe265e38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to