Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4626

lucene totalGroupCount always 0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: modules/grouping
    • Environment:

      win7 + JDK6.0

    • Lucene Fields:
      New

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              becky825 zyfan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5h
                5h
                Remaining:
                Remaining Estimate - 5h
                5h
                Logged:
                Time Spent - Not Specified
                Not Specified