Hi everyone - I am wondering if ElasticSearch provides a mechanism wherein
an insert/update of a document is allowed only if a specified condition is
met.
Lets say that I have a document with id=id1 and my_version=8. Now an update
to this document should be allowed only if the field my_version has a value
greater than 8. If not, the update should not be done.
For my use case, I have more than one applications (message bus) entering
data into ES server and I want to ensure that an existing copy of the
document does not get overwritten with a stale copy, hence I have a
versioning system of my own.
Hi everyone - I am wondering if Elasticsearch provides a mechanism wherein
an insert/update of a document is allowed only if a specified condition is
met.
Lets say that I have a document with id=id1 and my_version=8. Now an
update to this document should be allowed only if the field my_version has
a value greater than 8. If not, the update should not be done.
For my use case, I have more than one applications (message bus) entering
data into ES server and I want to ensure that an existing copy of the
document does not get overwritten with a stale copy, hence I have a
versioning system of my own.
Hi Clint - This is super helpful, thanks a lot! A follow up question: Do I
need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
Hi everyone - I am wondering if Elasticsearch provides a mechanism
wherein an insert/update of a document is allowed only if a specified
condition is met.
Lets say that I have a document with id=id1 and my_version=8. Now an
update to this document should be allowed only if the field my_version has
a value greater than 8. If not, the update should not be done.
For my use case, I have more than one applications (message bus) entering
data into ES server and I want to ensure that an existing copy of the
document does not get overwritten with a stale copy, hence I have a
versioning system of my own.
Here is a version of the documentation I wrote after reading the on-line
documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by one
after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document will be
updated as assigned this version if it doesn't already exist, or if it
exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question: Do I
need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
Here is a version of the documentation I wrote after reading the on-line
documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by one
after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document will be
updated as assigned this version if it doesn't already exist, or if it
exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question: Do
I need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
Here is a version of the documentation I wrote after reading the on-line
documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by
one after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document will
be updated as assigned this version if it doesn't already exist, or if it
exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question: Do
I need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
If you use the Java API you don't use the REST endpoint but directly the
binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I haven't
found a way to specify query params in the url (...&version_type=external)
.
Any recommendations on how to specify the version_type when using Java API?
-Amit.
On Sat, Sep 7, 2013 at 2:32 PM, Amit Soni <amits...@gmail.com<javascript:>
wrote:
Thanks much Brian, appreciate your response!
-Amit.
On Fri, Sep 6, 2013 at 4:33 PM, InquiringMind <brian....@gmail.com<javascript:>
wrote:
Amit,
Here is a version of the documentation I wrote after reading the on-line
documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by
one after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document will
be updated as assigned this version if it doesn't already exist, or if it
exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question:
Do I need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
Note that the "rec" variable is my own object (record == document) and
the methods should be fairly self-evident: rec.hasVersion returns true
if a version is specified; rec.isVersionExternal returns true for an
external version and false for an internal version, and its other
methods should be self-evident as well:
if (rec.hasVersion())
{
irb.setVersion(rec.getVersion());
if (rec.isVersionExternal())
irb.setVersionType(VersionType.EXTERNAL);
}
Hope this helps!
Brian
On Tuesday, September 10, 2013 8:50:02 PM UTC-4, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I haven't
found a way to specify query params in the url (...&version_type=external)
.
Any recommendations on how to specify the version_type when using Java API?
-Amit.
On Sat, Sep 7, 2013 at 2:32 PM, Amit Soni <amits...@gmail.com<javascript:>
wrote:
Thanks much Brian, appreciate your response!
-Amit.
On Fri, Sep 6, 2013 at 4:33 PM, InquiringMind <brian....@gmail.com<javascript:>
wrote:
Amit,
Here is a version of the documentation I wrote after reading the on-line
documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by
one after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document will
be updated as assigned this version if it doesn't already exist, or if it
exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question:
Do I need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Luca - My bad, I should have additionally specified that I have been
using JEST client to make REST based calls. This puts a limitation in me
specifying verstion_type in the request url.
If you use the Java API you don't use the REST endpoint but directly the
binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I haven't
found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using Java
API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by
one after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document will
be updated as assigned this version if it doesn't already exist, or if it
exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question:
Do I need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.com.
I see! I'm not familiar enough with Jest to answer this question then. I
had a brief look at it but couldn't find the answer, sorry about that.
On Wednesday, September 11, 2013 10:30:25 PM UTC+2, amit.soni wrote:
Hi Luca - My bad, I should have additionally specified that I have been
using JEST client to make REST based calls. This puts a limitation in me
specifying verstion_type in the request url.
-Amit.
On Wed, Sep 11, 2013 at 5:07 AM, Luca Cavanna <cavan...@gmail.com<javascript:>
wrote:
If you use the Java API you don't use the REST endpoint but directly the
binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I haven't
found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using Java
API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment by
one after each update to a document. When indexing or deleting an existing
document, an internal version number must match the document's version or
the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document
will be updated as assigned this version if it doesn't already exist, or if
it exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up question:
Do I need to specify version_type=external with each index request or can I
specify it one time in setting/mapping while creating the index? I tried
to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.com.
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
I see! I'm not familiar enough with Jest to answer this question then. I
had a brief look at it but couldn't find the answer, sorry about that.
On Wednesday, September 11, 2013 10:30:25 PM UTC+2, amit.soni wrote:
Hi Luca - My bad, I should have additionally specified that I have been
using JEST client to make REST based calls. This puts a limitation in me
specifying verstion_type in the request url.
If you use the Java API you don't use the REST endpoint but directly the
binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I
haven't found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using Java
API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment
by one after each update to a document. When indexing or deleting an
existing document, an internal version number must match the document's
version or the operation will be rejected.
If the version number is specified as internal, then: If the document
doesn't exist, it must start at 1, and if the document exists its version
must be equal to the specified version number.
External version numbers for a document start at whatever value is
specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document
will be updated as assigned this version if it doesn't already exist, or if
it exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up
question: Do I need to specify version_type=external with each index
request or can I specify it one time in setting/mapping while creating the
index? I tried to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.**com.
Not really, we don't currently have a real client written in Java that uses
the REST apis. JEST is the only one I'm aware of. On the other hand it is
quite easy to send http requests through whatever http client.
May I ask what is the reason why you chose not to use for instance the
TransportClient provided with the Java API?
I see! I'm not familiar enough with Jest to answer this question then. I
had a brief look at it but couldn't find the answer, sorry about that.
On Wednesday, September 11, 2013 10:30:25 PM UTC+2, amit.soni wrote:
Hi Luca - My bad, I should have additionally specified that I have been
using JEST client to make REST based calls. This puts a limitation in me
specifying verstion_type in the request url.
If you use the Java API you don't use the REST endpoint but directly
the binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I
haven't found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using Java
API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment
by one after each update to a document. When indexing or deleting an
existing document, an internal version number must match the document's
version or the operation will be rejected.
If the version number is specified as internal, then: If the
document doesn't exist, it must start at 1, and if the document exists its
version must be equal to the specified version number.
External version numbers for a document start at whatever value
is specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document
will be updated as assigned this version if it doesn't already exist, or if
it exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up
question: Do I need to specify version_type=external with each index
request or can I specify it one time in setting/mapping while creating the
index? I tried to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.**com.
Luca - That is a good question. Reading through some of the articles on the
web, I realized that it is much easier to debug problems if the
communication happens using http/json. I can log the request and play it
easily.
Secondly, using TransportClient seems to be including client code as part
of the cluster and I think client should be outside of the cluster.
I would love to hear your thoughts on the same. Since we are setting up the
infrastructure at this point, it would help to know the pros and cons.
Not really, we don't currently have a real client written in Java that
uses the REST apis. JEST is the only one I'm aware of. On the other hand it
is quite easy to send http requests through whatever http client.
May I ask what is the reason why you chose not to use for instance the
TransportClient provided with the Java API?
I see! I'm not familiar enough with Jest to answer this question then. I
had a brief look at it but couldn't find the answer, sorry about that.
On Wednesday, September 11, 2013 10:30:25 PM UTC+2, amit.soni wrote:
Hi Luca - My bad, I should have additionally specified that I have been
using JEST client to make REST based calls. This puts a limitation in me
specifying verstion_type in the request url.
If you use the Java API you don't use the REST endpoint but directly
the binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I
haven't found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using
Java API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update request.
Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and increment
by one after each update to a document. When indexing or deleting an
existing document, an internal version number must match the document's
version or the operation will be rejected.
If the version number is specified as internal, then: If the
document doesn't exist, it must start at 1, and if the document exists its
version must be equal to the specified version number.
External version numbers for a document start at whatever value
is specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document
will be updated as assigned this version if it doesn't already exist, or if
it exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up
question: Do I need to specify version_type=external with each index
request or can I specify it one time in setting/mapping while creating the
index? I tried to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.**com.
By the way if you use the TransportClient you effectively don't join the
cluster, but connect to some nodes in round-robin fashion, which seems to
be what you're looking for. I'd give it a try if you haven't done it yet.
I think we might provide a Java REST client in the future to address the
facet that the Java API is powerful, but sometimes too much for a client.
On the other hand the performance should be better and it is not that
different from using rest, I mean to debug as you mentioned it as the first
point.
Luca - That is a good question. Reading through some of the articles on
the web, I realized that it is much easier to debug problems if the
communication happens using http/json. I can log the request and play it
easily.
Secondly, using TransportClient seems to be including client code as part
of the cluster and I think client should be outside of the cluster.
I would love to hear your thoughts on the same. Since we are setting up
the infrastructure at this point, it would help to know the pros and cons.
Not really, we don't currently have a real client written in Java that
uses the REST apis. JEST is the only one I'm aware of. On the other hand it
is quite easy to send http requests through whatever http client.
May I ask what is the reason why you chose not to use for instance the
TransportClient provided with the Java API?
I see! I'm not familiar enough with Jest to answer this question then.
I had a brief look at it but couldn't find the answer, sorry about that.
On Wednesday, September 11, 2013 10:30:25 PM UTC+2, amit.soni wrote:
Hi Luca - My bad, I should have additionally specified that I have
been using JEST client to make REST based calls. This puts a limitation in
me specifying verstion_type in the request url.
If you use the Java API you don't use the REST endpoint but directly
the binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I
haven't found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using
Java API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update
request. Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and
increment by one after each update to a document. When indexing or deleting
an existing document, an internal version number must match the document's
version or the operation will be rejected.
If the version number is specified as internal, then: If the
document doesn't exist, it must start at 1, and if the document exists its
version must be equal to the specified version number.
External version numbers for a document start at whatever value
is specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document
will be updated as assigned this version if it doesn't already exist, or if
it exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up
question: Do I need to specify version_type=external with each index
request or can I specify it one time in setting/mapping while creating the
index? I tried to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.**com.
The source URL parameter allows you to pass in a pre-constructed query in
Json format in a GET request.
This returns an HTTP GET URL you can stick in a browser and debug queries
all you want.
Ross
On Saturday, 14 September 2013 03:36:21 UTC+10, amit.soni wrote:
Luca - That is a good question. Reading through some of the articles on
the web, I realized that it is much easier to debug problems if the
communication happens using http/json. I can log the request and play it
easily.
Secondly, using TransportClient seems to be including client code as part
of the cluster and I think client should be outside of the cluster.
I would love to hear your thoughts on the same. Since we are setting up
the infrastructure at this point, it would help to know the pros and cons.
-Amit.
On Thu, Sep 12, 2013 at 2:32 PM, Luca Cavanna <cavan...@gmail.com<javascript:>
wrote:
Not really, we don't currently have a real client written in Java that
uses the REST apis. JEST is the only one I'm aware of. On the other hand it
is quite easy to send http requests through whatever http client.
May I ask what is the reason why you chose not to use for instance the
TransportClient provided with the Java API?
On Thu, Sep 12, 2013 at 11:13 PM, Amit Soni <amits...@gmail.com<javascript:>
wrote:
Thanks Luca. Do you have a recommendation on what approach to take in
order to make REST based calls from Java application (apart from using
JEST).
-Amit.
On Thu, Sep 12, 2013 at 4:27 AM, Luca Cavanna <cavan...@gmail.com<javascript:>
wrote:
I see! I'm not familiar enough with Jest to answer this question then.
I had a brief look at it but couldn't find the answer, sorry about that.
On Wednesday, September 11, 2013 10:30:25 PM UTC+2, amit.soni wrote:
Hi Luca - My bad, I should have additionally specified that I have
been using JEST client to make REST based calls. This puts a limitation in
me specifying verstion_type in the request url.
If you use the Java API you don't use the REST endpoint but directly
the binary format that elasticsearch uses internally for inter-node
communications. That's the very same format all REST requests are
translated to. Every api that supports the version_type parameter exposes
proper setters for it. It is called setVersionType on the request builder
and versionType on the Request class.
Cheers
Luca
On Wednesday, September 11, 2013 2:50:02 AM UTC+2, amit.soni wrote:
Actually I have a follow up question: I am using Java APIs and I
haven't found a way to specify query params in the url (...&version_type=
external).
Any recommendations on how to specify the version_type when using
Java API?
Here is a version of the documentation I wrote after reading the
on-line documentation and then experimenting:
The version number is internal or external on a per-update
request. Elasticsearch implements the following behaviors:
Internal version numbers for a document start at 1 and
increment by one after each update to a document. When indexing or deleting
an existing document, an internal version number must match the document's
version or the operation will be rejected.
If the version number is specified as internal, then: If the
document doesn't exist, it must start at 1, and if the document exists its
version must be equal to the specified version number.
External version numbers for a document start at whatever value
is specified by the application. When indexing or deleting an existing
document, an external version number must be greater than the document's
version or the operation will be rejected. When the operation completes
successfully, the document's version will be the externally specified
version number.
If the version number is specified as external, then: The document
will be updated as assigned this version if it doesn't already exist, or if
it exists and the specified version is greater than the document's existing
version.
Brian
On Friday, September 6, 2013 5:18:09 PM UTC-4, amit.soni wrote:
Hi Clint - This is super helpful, thanks a lot! A follow up
question: Do I need to specify version_type=external with each index
request or can I specify it one time in setting/mapping while creating the
index? I tried to search on Google for examples but couldn't find any.
-Amit.
--
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 elasticsearc...@**googlegroups.**com.
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
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.