diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-05-27 15:35:57 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-05-27 15:35:57 +0200 |
commit | a8497f8a87c1c408b1ecca6d1d044f8112916e08 (patch) | |
tree | 115078c396c2937f941c8fc826476320a887ad5c /container-search/src/main/java/com/yahoo/prelude/searcher | |
parent | aae02d03c2db96618d6643166e494527c1dfd2de (diff) |
Reapply parts of the iterate-indexes commit.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/searcher')
3 files changed, 16 insertions, 12 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/searcher/DocumentSourceSearcher.java b/container-search/src/main/java/com/yahoo/prelude/searcher/DocumentSourceSearcher.java index 415ebd7871c..2f9e81c1607 100644 --- a/container-search/src/main/java/com/yahoo/prelude/searcher/DocumentSourceSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/searcher/DocumentSourceSearcher.java @@ -27,9 +27,12 @@ import java.util.Set; * will be returned when attribute prefetch filling is requested.</p> * * @author bratseth + * @deprecated use {@link com.yahoo.search.searchchain.testutil.DocumentSourceSearcher} */ @SuppressWarnings({"rawtypes"}) +@Deprecated // TODO: Remove on Vespa 7 public class DocumentSourceSearcher extends Searcher { + // as for the SuppressWarnings annotation above, we are inside // com.yahoo.prelude, this is old stuff, really no point firing off those // warnings here... @@ -38,7 +41,6 @@ public class DocumentSourceSearcher extends Searcher { private Map<Query, Result> completelyFilledResults = new HashMap<>(); private Map<Query, Result> attributeFilledResults = new HashMap<>(); private Map<Query, Result> unFilledResults = new HashMap<>(); - //private Result defaultUnfilledResult; /** Time (in ms) at which the index of this searcher was last modified */ long editionTimeStamp=0; @@ -101,11 +103,11 @@ public class DocumentSourceSearcher extends Searcher { } /** - * Returns a query clone which has offset and hits set to null. This is used by access to + * Returns a query clone which has source, offset and hits set to null. This is used by access to * the maps using the query as key to achieve lookup independent of offset/hits value */ - private com.yahoo.search.Query getQueryKeyClone(com.yahoo.search.Query query) { - com.yahoo.search.Query key=query.clone(); + private Query getQueryKeyClone(Query query) { + Query key = query.clone(); key.setWindow(0,0); key.getModel().setSources(""); return key; diff --git a/container-search/src/main/java/com/yahoo/prelude/searcher/FieldCollapsingSearcher.java b/container-search/src/main/java/com/yahoo/prelude/searcher/FieldCollapsingSearcher.java index 71e54c810c2..21fa8962da4 100644 --- a/container-search/src/main/java/com/yahoo/prelude/searcher/FieldCollapsingSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/searcher/FieldCollapsingSearcher.java @@ -19,10 +19,9 @@ import java.util.Map; /** - * A searcher which does parametrized collapsing. Based on - * SiteCollapsingSearcher. Deprecated - use grouping. + * A searcher which does parametrized collapsing. * - * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> + * @author Steinar Knutsen */ @SuppressWarnings("deprecation") @After(PhaseNames.RAW_QUERY) @@ -174,17 +173,18 @@ public class FieldCollapsingSearcher extends Searcher { } if (knownCollapses.containsKey(collapseId)) { - int numHitsThisField = knownCollapses.get(collapseId).intValue(); + int numHitsThisField = knownCollapses.get(collapseId); if (numHitsThisField < collapseSize) { result.hits().add(hit); ++numHitsThisField; - knownCollapses.put(collapseId, Integer.valueOf(numHitsThisField)); + knownCollapses.put(collapseId, numHitsThisField); } } else { - knownCollapses.put(collapseId, Integer.valueOf(1)); + knownCollapses.put(collapseId, 1); result.hits().add(hit); } } } + } diff --git a/container-search/src/main/java/com/yahoo/prelude/searcher/JSONDebugSearcher.java b/container-search/src/main/java/com/yahoo/prelude/searcher/JSONDebugSearcher.java index c18f3d49da3..2330ca2382a 100644 --- a/container-search/src/main/java/com/yahoo/prelude/searcher/JSONDebugSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/searcher/JSONDebugSearcher.java @@ -16,16 +16,17 @@ import java.util.Iterator; /** * Save the query in the incoming state to a meta hit in the result. * - * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> + * @author Steinar Knutsen */ - public class JSONDebugSearcher extends Searcher { + public static final String JSON_FIELD = "JSON field: "; public static final String STRUCT_FIELD = "Structured data field (as json): "; public static final String FEATURE_FIELD = "Feature data field (as json): "; private static CompoundName PROPERTYNAME = new CompoundName("dumpjson"); + @Override public Result search(com.yahoo.search.Query query, Execution execution) { Result r = execution.search(query); String propertyName = query.properties().getString(PROPERTYNAME); @@ -53,4 +54,5 @@ public class JSONDebugSearcher extends Searcher { } return r; } + } |