use of com.yahoo.search.query.Sorting in project vespa by vespa-engine.
the class UniqueGroupingSearcherTestCase method testBuildGroupingExpression.
@Test
public void testBuildGroupingExpression() throws Exception {
assertEquals("all(group(title) max(11) output(count() as(uniqueCount)) each(max(1) each(output(summary())) " + "as(uniqueHits)))", UniqueGroupingSearcher.buildGroupingExpression("title", 11, null, null).toString());
assertEquals("all(group(fingerprint) max(5) output(count() as(uniqueCount)) each(max(1) " + "each(output(summary(attributeprefetch))) as(uniqueHits)))", UniqueGroupingSearcher.buildGroupingExpression("fingerprint", 5, "attributeprefetch", null).toString());
assertEquals("all(group(fingerprint) max(5) order(neg(max(pubdate))) output(count() as(uniqueCount)) each(" + "all(group(neg(pubdate)) max(1) order(neg(max(pubdate))) each(each(output(summary())) " + "as(uniqueHits)) as(uniqueGroups))))", UniqueGroupingSearcher.buildGroupingExpression("fingerprint", 5, null, new Sorting("-pubdate")).toString());
assertEquals("all(group(fingerprint) max(5) order(min(pubdate)) output(count() as(uniqueCount)) each(" + "all(group(pubdate) max(1) order(min(pubdate)) each(each(output(summary(attributeprefetch))) " + "as(uniqueHits)) as(uniqueGroups))))", UniqueGroupingSearcher.buildGroupingExpression("fingerprint", 5, "attributeprefetch", new Sorting("+pubdate")).toString());
}
Aggregations