Why newly created document has version 2?

I used upsert API and print UpdateResponse

StringBuilder sb = new StringBuilder();
        sb.append("{\"_index\":\"").append(response.getIndex()).append("\",\"_type\":\"")
            .append(response.getType()).append("\",\"_id\":\"").append(response.getId())
            .append("\",\"_version\":\"").append(response.getVersion())
            .append("\",\"created\":\"").append(response.isCreated()).append("}");

and I found below resposne:

{"_index":"bs-list_r","_type":"list","_id":"1031438199","_version":"2","created":"true}

so my question is: why created doc has _version 2?
is it by design or is it a bug?
if it is by design, can give more description or share some useful info please.

@dadoonet
@jprante
@nik9000
@jpountz
can u guys help to answer?

Please don't ping people like this. This is so annoying.

Wait for someone to pick your question.

Can you reproduce it with a curl script please?

See this page in the definitive guide for details on versioning: https://www.elastic.co/guide/en/elasticsearch/guide/master/optimistic-concurrency-control.html#optimistic-concurrency-control

are u saying that I upsert data with giving certain version number? if so, I am telling u that I am not. I am not giving any version number when I upsert document. most of the docs' version is 1 when create=true, only a few with 2.

That's why

Can you reproduce it with a curl script please?

would help a lot to see if it's actually an issue...

I create a script and all response turns out to be "_version":1

It means you are may be doing something wrong in the other code or you did change a document which was already existing...

you are damn right.but what exactly something wrong is? isn't server should response for this some way?