summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/querytransform
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-08-14 11:15:12 +0200
committerJon Bratseth <bratseth@oath.com>2018-08-14 11:15:12 +0200
commit7b134d8ef30cc3bd6e0867ba3f47452d78d4fce0 (patch)
tree96ef67d3c9998c0f51c289d1e8cfb298b26f0e2f /container-search/src/main/java/com/yahoo/search/querytransform
parent216feb84a135cbcd3e20cdb3240a63fdb53439e3 (diff)
Fix Select and grouping bugs
- Deep copy the grouping structure on query copy. It is mutable but we have neglected doing this right until now. - Fix a bug in the previous commit where the last constructed Query.Model was shared between all instances. - Fix a bug in the previous commit where the query string instead of the query tree was reset when a new select expression is set. - Don't use deprecated method. - Clean up Javadoc and formatting.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/querytransform')
-rw-r--r--container-search/src/main/java/com/yahoo/search/querytransform/SortingDegrader.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/querytransform/SortingDegrader.java b/container-search/src/main/java/com/yahoo/search/querytransform/SortingDegrader.java
index 12a775e0a62..58eafef79de 100644
--- a/container-search/src/main/java/com/yahoo/search/querytransform/SortingDegrader.java
+++ b/container-search/src/main/java/com/yahoo/search/querytransform/SortingDegrader.java
@@ -37,7 +37,6 @@ import java.util.Set;
// We are checking if there is a grouping expression, not if there is a raw grouping instruction property,
// so we must run after the property is transferred to a grouping expression
@After(GroupingQueryParser.SELECT_PARAMETER_PARSING)
-
public class SortingDegrader extends Searcher {
/** Set this to false in query.properties to turn off degrading. Default: on */
@@ -56,7 +55,7 @@ public class SortingDegrader extends Searcher {
private boolean shouldBeDegraded(Query query, IndexFacts.Session indexFacts) {
if (query.getRanking().getSorting() == null) return false;
if (query.getRanking().getSorting().fieldOrders().isEmpty()) return false;
- if ( ! GroupingRequest.getRequests(query).isEmpty()) return false;
+ if ( ! query.getSelect().getGrouping().isEmpty()) return false;
if ( ! query.properties().getBoolean(DEGRADING, true)) return false;
Index index = indexFacts.getIndex(query.getRanking().getSorting().fieldOrders().get(0).getFieldName());