when following the guide regarding the version stuff all is fine:
Now I wanted to have this in my java project and tried the following:
But the search results in version -1 although I would expect 1 like it
is the case for the curl experiment.
This is especially bad as I want to fill the version from the
retrieved object and when feeding with a negative version ES throws an
exception **
What am I doing wrong?
Regards,
Peter.
**
Exception in thread "main"
org.elasticsearch.index.engine.VersionConflictEngineException: [index1]
[0] [something][1]: version conflict, current [-1], required [-1]
at
org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:
421)
at
org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:
374)
at
org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:
292)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
183)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:
418)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.access
$100(TransportShardReplicationOperationAction.java:233)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction
$1.run(TransportShardReplicationOperationAction.java:331)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
But the search results in version -1 although I would expect 1 like it
is the case for the curl experiment.
This is especially bad as I want to fill the version from the
retrieved object and when feeding with a negative version ES throws an
exception **
What am I doing wrong?
Regards,
Peter.
**
Exception in thread "main"
org.elasticsearch.index.engine.VersionConflictEngineException: [index1]
[0] [something][1]: version conflict, current [-1], required [-1]
at
org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:
421)
at
org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:
374)
at
org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:
292)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:
183)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:
418)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction.access
$100(TransportShardReplicationOperationAction.java:233)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
$AsyncShardOperationAction
$1.run(TransportShardReplicationOperationAction.java:331)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Thank you very much, I joined this forum to find answer for why java api returning -1 as version. Glad i did a search before posting a question. New to elastic search thoroughly enjoying its features. Java integration is first class.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.