-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for CRUD operations #22
Conversation
Fix config loading for ElasticModule
Add Travis badge and extra config information to README
Add ElasticSearchClient and binding
Parse SearchResponse using Play JSON
Extracted ElasticSearchClient interface and renamed implementation
Collapsed update and insert into upsert
Throw an exception when doc is not a JsObject
Added test which checks proper json parsing
Bulk inserts
Inject index types
Split configuration loaders
Fix wrong indexTypes configuration
Add ES update operation
Add Sonatype publishing
Update README for index bindings
* @param exc the execution context | ||
* @return a [[PreparedGet]] instance encapsulating the query | ||
*/ | ||
def get(id: String, docType: IndexType)(implicit exc: ExecutionContext): PreparedGet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id: String
Worries me a bit, since in elastic4s
the type of id
is Any
. @WojciechP @abankowski Do you think we should use Any
here for compatibility, or (preferably ;P ) any other ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's sad, afair they call toString under the hood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Strings is fine imo. The scaladocs are slightly broken, though - they require full paths in links, so you should say [[com.evojam.play.elastic4s.client.core.crud.PreparedGet]]
instead. Run sbt doc
to generate documentation and see the warnings.
.filter(_.isExists) | ||
.map(_.getSourceAsBytes) | ||
.map(Json.parse) | ||
.map(_.as[T]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be more tolerant with as[T]
or assume that if the documents received are not parseable then this is an exceptional situation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd assume that if someone is aware of inconsistent schema, they should provide a proper Reads instance (e.g. Reads[Either[OldApiEntity, NewApiEntity]]
). Throwing an exception is a sane behavior.
2b5e59d
to
4816d00
Compare
The API design has changed - we will leave underlying |
Resolves #17