Skip to content

Commit

Permalink
Missing local-preference for search #7668
Browse files Browse the repository at this point in the history
  • Loading branch information
GlennRicaud authored and rymsha committed Jan 29, 2020
1 parent 974b939 commit 956b370
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import com.google.common.collect.ImmutableSet;

import com.enonic.xp.repo.impl.SearchPreference;
import com.enonic.xp.repo.impl.elasticsearch.query.ElasticsearchQuery;
import com.enonic.xp.repo.impl.elasticsearch.result.SearchResultFactory;
import com.enonic.xp.repo.impl.search.result.SearchResult;
Expand Down Expand Up @@ -88,6 +89,7 @@ SearchRequestBuilder createScrollRequest( final ElasticsearchQuery query )
setPostFilter( query.getFilter() ).
setFrom( query.getFrom() ).
setSize( query.getBatchSize() ).
setPreference( SearchPreference.LOCAL.getName() ).
addFields( query.getReturnFields().getReturnFieldNames() );

query.getSortBuilders().forEach( searchRequestBuilder::addSort );
Expand Down

0 comments on commit 956b370

Please sign in to comment.