These are chat archives for ReactiveX/RxJava

Jan 2016
Josh Durbin
Jan 20 2016 02:08

Hey Gang. Question:

I’ve had something on here a bit ago regarding the conversion of Elasticsearch Futures to Observables. I’ve got all that working, but now I want to map search ‘hits’ to a particular domain object. It appears the Java ES API does not support codecs, so I thought I’d map over the observables. One hiccup, though, the observable is a wrapper that contains another data in addition to a list of Hits.

In this API, I’m converting a Future<SearchResponse> to Observable<SearchResponse>. SearchResponse has a variable, class SearchHits, which itself has a list (or array, more accurately) of type SearchHit.

So, from search response: searchResponse.getHits().hits() returns SearchHit[].

How do I map a single searchResponse such that it emmits each individual SearchHit?

Josh Durbin
Jan 20 2016 06:34
To put another way, what’s the best way of taking a single observable, accessing a member of the observable and emitting an observable of a different type, preferrably via an iterable
Jan 20 2016 08:42
ToBlocking ?
(im making wild guesses here)