Skip to content

Commit

Permalink
fixes parser
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Apr 7, 2018
1 parent 1fcb71c commit 2f9e37b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -128,7 +128,7 @@ public List<DocumentEntity> search(QueryBuilder query, String... types) throws N
SearchResponse search = client.search(searchRequest);

return stream(search.getHits().spliterator(), false)
.map(h -> new ElasticsearchEntry(h.getId(), h.getIndex(), h.getSourceAsMap()))
.map(ElasticsearchEntry::of)
.filter(ElasticsearchEntry::isNotEmpty)
.map(ElasticsearchEntry::toEntity)
.collect(Collectors.toList());
Expand Down
Expand Up @@ -56,7 +56,7 @@ public void onResponse(MultiGetResponse multiGetItemResponses) {

Stream.of(multiGetItemResponses.getResponses())
.map(MultiGetItemResponse::getResponse)
.map(h -> new ElasticsearchEntry(h.getId(), collection, h.getSourceAsMap()))
.map(ElasticsearchEntry::of)
.filter(ElasticsearchEntry::isNotEmpty)
.map(ElasticsearchEntry::toEntity)
.forEach(entities::add);
Expand All @@ -79,7 +79,7 @@ ActionListener<SearchResponse> getSearch() {
public void onResponse(SearchResponse searchResponse) {
query.set(true);
stream(searchResponse.getHits().spliterator(), false)
.map(h -> new ElasticsearchEntry(h.getId(), collection, h.getSourceAsMap()))
.map(ElasticsearchEntry::of)
.filter(ElasticsearchEntry::isNotEmpty)
.map(ElasticsearchEntry::toEntity)
.forEach(entities::add);
Expand Down
Expand Up @@ -37,7 +37,7 @@ class FindQueryBuilderListener implements ActionListener<SearchResponse> {
@Override
public void onResponse(SearchResponse searchResponse) {
List<DocumentEntity> entities = stream(searchResponse.getHits().spliterator(), false)
.map(h -> new ElasticsearchEntry(h.getId(), h.getIndex(), h.getSourceAsMap()))
.map(ElasticsearchEntry::of)
.filter(ElasticsearchEntry::isNotEmpty)
.map(ElasticsearchEntry::toEntity)
.collect(Collectors.toList());
Expand Down

0 comments on commit 2f9e37b

Please sign in to comment.