Skip to content

Commit

Permalink
HSEARCH-4142 Use projection id in real backend
Browse files Browse the repository at this point in the history
  • Loading branch information
fax4ever committed Mar 1, 2021
1 parent fc2e471 commit fa5bc5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -88,11 +88,10 @@ private List<Integer> searchAllIds() {
List<Integer> results = new ArrayList<>();
withinJPATransaction( entityManagerFactory, entityManager -> Search.session( entityManager )
.search( Book.class )
.select( f -> f.entityReference() )
.select( f -> f.id( Integer.class ) )
.where( f -> f.matchAll() )
.fetchAllHits()
.stream()
.map( ref -> (Integer) ref.id() )
.forEach( results::add ) );
return results;
}
Expand Down
Expand Up @@ -99,12 +99,11 @@ private List<Integer> searchIdsByRoutingKey(Genre genre) {
List<Integer> results = new ArrayList<>();
withinJPATransaction( entityManagerFactory, entityManager -> Search.session( entityManager )
.search( Book.class )
.select( f -> f.entityReference() )
.select( f -> f.id( Integer.class ) )
.where( f -> f.matchAll() )
.routing( routingKey )
.fetchAllHits()
.stream()
.map( ref -> (Integer) ref.id() )
.forEach( results::add ) );
return results;
}
Expand Down

0 comments on commit fa5bc5c

Please sign in to comment.