You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "zyfan (JIRA)" <ji...@apache.org> on 2012/12/13 07:31:22 UTC

[jira] [Created] (LUCENE-4626) lucene totalGroupCount always 0

zyfan created LUCENE-4626:
-----------------------------

             Summary: lucene totalGroupCount always 0
                 Key: LUCENE-4626
                 URL: https://issues.apache.org/jira/browse/LUCENE-4626
             Project: Lucene - Core
          Issue Type: Bug
          Components: modules/grouping
    Affects Versions: 4.0
         Environment: win7 + JDK6.0
            Reporter: zyfan


i want group in lucene ,i find group demo for lucene 4.0 API,
this is my code:
Analyzer analyzer=new WhitespaceAnalyzer(Version.LUCENE_40);
		
DirectoryReader indexReader=DirectoryReader.open(FSDirectory.open(new File(indexDir)));
IndexSearcher isearcher = new IndexSearcher(indexReader);
		
GroupingSearch groupingSearch = new GroupingSearch("CsCode");
groupingSearch.setGroupSort(Sort.INDEXORDER);
groupingSearch.setFillSortFields(true);
		
		
if (true) {
	// Sets cache in MB
	groupingSearch.setCachingInMB(100.0, true);
	}
		
if (true) {
	groupingSearch.setAllGroups(true);
		    
}
		
QueryParser parser = new QueryParser(Version.LUCENE_40, "OneBestText1", analyzer);
Query query = parser.parse("你好");
TopGroups<String> result = groupingSearch.search(isearcher, query, 0, 5000);
		
// Render groupsResult...
if (true) {
	int totalGroupCount = result.totalGroupCount;
		   
	 System.out.println(totalGroupCount);
	}

the totalGroupCount always 0 but result.groups.length is 590.
i donot know why ,please help

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org