

TopGroups groupsResult = c2.getTopGroups(docOffset) S.search(new TermQuery(new Term("content", searchTerm)), c2) Cache was too large must re-execute query: Cache fit within maxCacheRAMMB, so we can replay it: SecondPassGroupingCollector c2 = new SecondPassGroupingCollector("author", topGroups, groupSort, docSort, docOffset+docsPerGroup, getScores, getMaxScores, fillFields) ĪllGroupsCollector allGroupsCollector = null ĪllGroupsCollector = new AllGroupsCollector("author") Ĭ2 = MultiCollector.wrap(c2, allGroupsCollector) S.search(new TermQuery(new Term("content", searchTerm)), cachedCollector) Ĭollection topGroups = c1.getTopGroups(groupOffset, fillFields) Typical usage looks like this (using the CachingCollector):įirstPassGroupingCollector c1 = new FirstPassGroupingCollector("author", groupSort, groupOffset+topNGroups) ĬachingCollector cachedCollector = CachingCollector.create(c1, cacheScores, maxCacheRAMMB)

groupOffset: which "slice" of top groups you want to.ForĮxample, 10 means the top 10 groups are computed. than those detailed in this guide, see the official Apache Lucene search. topNGroups: how many top groups to keep. This guide provides an overview on building Lucene queries for use in the.Specify relevance group sort, then the first group is the one Is the one with the lowest price book within it. ForĮxample, if you specify "price" (ascending) then the first group Purposes, each group is "represented" by the highest-sortedĭocument according to the groupSort within it. Have this field are grouped under a single group with Desired results: SQL Server query equivalent: SELECT Product.ID, Product. groupField: this is the field used for grouping.įor example, if you use the author field then each Example input list of products: Query: SELECT Product.ID, Product.Decription, Product.Name FROM Product.For example, if you group by the authorįield, then all documents with the same value in the author

With the same value in the specified single-valued group field are This module enables search result grouping with Lucene, where hits
