diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-04-26 15:12:49 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-04-26 15:12:49 +0200 |
commit | 5f35f84715de58bfcfe0c5332f60e76ca96c6f7d (patch) | |
tree | 83192060f6616e33656318c981a045bd0f9adcd5 /container-search/src/main/java/com/yahoo/search/federation | |
parent | d11721c9bb7b532a2c3471232e68a95ce442d895 (diff) |
Cleanup some unmaintainable mess
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/federation')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/federation/FederationSearcher.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/federation/FederationSearcher.java b/container-search/src/main/java/com/yahoo/search/federation/FederationSearcher.java index 9034484b022..686c019688e 100644 --- a/container-search/src/main/java/com/yahoo/search/federation/FederationSearcher.java +++ b/container-search/src/main/java/com/yahoo/search/federation/FederationSearcher.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.federation; +import com.google.common.collect.ImmutableList; import com.google.inject.Inject; import com.yahoo.collections.Pair; import com.yahoo.component.ComponentId; @@ -93,6 +94,8 @@ public class FederationSearcher extends ForkingSearcher { private final Clock clock = Clock.systemUTC(); + private static final List<CompoundName> queryAndHits = ImmutableList.of(Query.OFFSET, Query.HITS); + @Inject public FederationSearcher(FederationConfig config, StrictContractsConfig strict, ComponentRegistry<TargetSelector> targetSelectors) { @@ -277,11 +280,11 @@ public class FederationSearcher extends ForkingSearcher { switch (propagateSourceProperties) { case ALL: propagatePerSourceQueryProperties(query, outgoing, window, sourceName, providerName, - QueryProperties.PER_SOURCE_QUERY_PROPERTIES); + Query.nativeProperties); break; case OFFSET_HITS: propagatePerSourceQueryProperties(query, outgoing, window, sourceName, providerName, - new CompoundName[]{Query.OFFSET, Query.HITS}); + queryAndHits); break; } @@ -293,7 +296,7 @@ public class FederationSearcher extends ForkingSearcher { private void propagatePerSourceQueryProperties(Query original, Query outgoing, Window window, String sourceName, String providerName, - CompoundName[] queryProperties) { + List<CompoundName> queryProperties) { for (CompoundName key : queryProperties) { Object value = getSourceOrProviderProperty(original, key, sourceName, providerName, window.get(key)); if (value != null) |