While developing a wrapper for elasticsearch for my application I got
a little confused with the asynchronous nature of the calls and the
Java API. The API is really neat, but it somewhat suffers from
ambiguity.
I think a few more examples with a full breakdown of each method would
really help a lot in clarifying all doubts.
Meanwhile I have some questions:
What does the execute() method on a request builder actually do?
What does the actionGet() method do?
If a resource is added to the indexer queue (if I understand
correctly, that's what happens after executing the prepareIndex
directive) is there anything that can do wrong with indexing later on?
If so, how to find out?
While developing a wrapper for elasticsearch for my application I got
a little confused with the asynchronous nature of the calls and the
Java API. The API is really neat, but it somewhat suffers from
ambiguity.
I think a few more examples with a full breakdown of each method would
really help a lot in clarifying all doubts.
Meanwhile I have some questions:
What does the execute() method on a request builder actually do?
Returns a Future, which you can use to either block for a response, or add a
listener to.
What does the actionGet() method do?
Blocks till the operation is executed and a response is returned.
If a resource is added to the indexer queue (if I understand
correctly, that's what happens after executing the prepareIndex
directive) is there anything that can do wrong with indexing later on?
If so, how to find out?
Calling prepareIndex (for example) does not do anything, calling execute
causes that call to be executed, and you can use the returned Future to
decide how to act on it. Calling actionGet makes it fully blocking call.
What are index() and delete() methods for?
Similar APIs to prepareIndex, just a different flavor. The one that returns
a response is a blocking call, the one that accepts a listener is not.
Thanks for clarifying those issues, it all makes sense now. I think
that some kind of Java API quick start tutorial would really help
developers who stumble upon this great project and thus increase the
number of production stories.
The existing guide forces the user to dig deep, which isn't always the
best way to learn something new.
While developing a wrapper for elasticsearch for my application I got
a little confused with the asynchronous nature of the calls and the
Java API. The API is really neat, but it somewhat suffers from
ambiguity.
I think a few more examples with a full breakdown of each method would
really help a lot in clarifying all doubts.
Meanwhile I have some questions:
What does the execute() method on a request builder actually do?
Returns a Future, which you can use to either block for a response, or add a
listener to.
What does the actionGet() method do?
Blocks till the operation is executed and a response is returned.
If a resource is added to the indexer queue (if I understand
correctly, that's what happens after executing the prepareIndex
directive) is there anything that can do wrong with indexing later on?
If so, how to find out?
Calling prepareIndex (for example) does not do anything, calling execute
causes that call to be executed, and you can use the returned Future to
decide how to act on it. Calling actionGet makes it fully blocking call.
What are index() and delete() methods for?
Similar APIs to prepareIndex, just a different flavor. The one that returns
a response is a blocking call, the one that accepts a listener is not.
A few more examples or explanations would make life easier, for sure. I became a real fan of this project, but digging deeper not everything is selfexplaning (at least in my eyes) and looking at examples is helpfull anyway. Shay, have you ever considered setting up a Wiki so users could help you with documentation? I'm sure a lot of people would benefit from it. And maybe you could transfer parts back to your guide or javadoc?
A few more examples or explanations would make life easier, for sure. I
became a real fan of this project, but digging deeper not everything is
selfexplaning (at least in my eyes) and looking at examples is helpfull
anyway. Shay, have you ever considered setting up a Wiki so users could
help
you with documentation? I'm sure a lot of people would benefit from it. And
maybe you could transfer parts back to your guide or javadoc?
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.