aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/searcher/DocumentSourceSearcher.java10
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java11
2 files changed, 11 insertions, 10 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/search/searchchain/testutil/DocumentSourceSearcher.java b/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java
index 56a6a702962..f4973ba4239 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java
@@ -28,7 +28,7 @@ import com.yahoo.search.searchchain.Execution;
* Any field in the configured hits which has a name starting by attribute
* will be returned when attribute prefetch filling is requested.</p>
*
- * @author bratseth
+ * @author bratseth
*/
public class DocumentSourceSearcher extends Searcher {
@@ -85,7 +85,6 @@ public class DocumentSourceSearcher extends Searcher {
private void addDefaultResults() {
Query q = new Query("?query=default");
Result r = new Result(q);
- // These four used to assign collapseId 1,2,3,4 - re-add that if needed
r.hits().add(new Hit("http://default-1.html", 0));
r.hits().add(new Hit("http://default-2.html", 0));
r.hits().add(new Hit("http://default-3.html", 0));
@@ -97,8 +96,7 @@ public class DocumentSourceSearcher extends Searcher {
@Override
public Result search(Query query, Execution execution) {
queryCount++;
- Result r;
- r = unFilledResults.get(getQueryKeyClone(query));
+ Result r = unFilledResults.get(getQueryKeyClone(query));
if (r == null) {
r = defaultFilledResult.clone();
} else {
@@ -111,12 +109,13 @@ 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 sourcr, 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 Query getQueryKeyClone(Query query) {
- Query key=query.clone();
+ Query key = query.clone();
key.setWindow(0,0);
+ key.getModel().setSources("");
return key;
}