Solr
  1. Solr
  2. SOLR-2780

Facet count problem : Multi-Select Faceting After grouping results

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.3, 3.4, 4.0-ALPHA
    • Fix Version/s: 3.5, 4.0-ALPHA
    • Component/s: search
    • Labels:
      None

      Description

      Dear All ,
      Kindly note that I am using Solr 4.0 and Kindly note that group.truncate=true calculates facet counts that based on the most relevant document of each group matching the query.

      But when I used Multi-Select Faceting [Tagging and excluding Filters] , the solr can't calculate the facet after grouping the results and select multi facet.

      http://127.0.0.1:8983/solr/select/?facet=true&sort=score+desc,+rate+desc,total_of_reviews+desc&facet.limit=-1&bf=sum%28product%28atan%28total_of_reviews%29,50%29,product%28rate,10%29%29^4&group.field=place_id&facet.field=

      {!ex%3Dce}cat_en&facet.field={!ex%3Dce}

      cat_ar&facet.field=

      {!ex%3Dir}iregion&facet.field={!ex%3Dir}

      region_en&facet.field=

      {!ex%3Dir}

      region_ar&facet.field=

      {!ex%3Drr}

      rrate&facet.field=place_status&facet.field=theme_en&facet.field=icity&facet.field=

      {!ex%3Dce}

      icat&facet.field=

      {!ex%3Dsce}isubcat&facet.field={!ex%3Dsce}

      subcat_en&facet.field=

      {!ex%3Dsce}

      subcat_ar&qt=/spell&fq=place_status:1&fq=icity:1&fq=cat_en:%28%22Restaurants%22%29&group.format=simple&group.ngroups=true&facet.mincount=1&qf=title_ar^24+title_en^24+cat_ar^10+cat_en^10++review^20&hl.fl=review&json.nl=map&wt=json&defType=edismax&rows=10&spellcheck.accuracy=0.6&start=0&q=smart&group.truncate=true&group=true&indent=on

      1. SOLR-2780.patch
        6 kB
        Martijn van Groningen
      2. SOLR-2780.patch
        2 kB
        Martijn van Groningen

        Activity

        Show
        Ramzi Alqrainy added a comment - http://lucene.472066.n3.nabble.com/Facet-count-problem-Multi-Select-Faceting-After-grouping-results-tc3346267.html
        Hide
        Martijn van Groningen added a comment -

        When excluding facets the search is re-executed (inside SimpleFacets) during the facet phase to get a DocSet for the search without some excluding filters. The problem is that for that search the group.truncate parameter isn't checked. This doesn't happen for normal facets, since the search isn't re-executed.

        I think to fix this, the SimpleFacets should re-execute the search with a AllGroupHeadsCollector when group.truncate=true at line 167.

        Show
        Martijn van Groningen added a comment - When excluding facets the search is re-executed (inside SimpleFacets) during the facet phase to get a DocSet for the search without some excluding filters. The problem is that for that search the group.truncate parameter isn't checked. This doesn't happen for normal facets, since the search isn't re-executed. I think to fix this, the SimpleFacets should re-execute the search with a AllGroupHeadsCollector when group.truncate=true at line 167.
        Hide
        Martijn van Groningen added a comment -

        Attached a patch that should fix this issue with the proposed solution.

        BTW only supports this when grouping by field . See todo in patch.

        Show
        Martijn van Groningen added a comment - Attached a patch that should fix this issue with the proposed solution. BTW only supports this when grouping by field . See todo in patch.
        Hide
        Ramzi Alqrainy added a comment -

        Hi Groningen,
        I have used your patch and I made FunctionAllGroupHeadsCollector public and when I execute this command
        ant dist to build , the below errors are displayed

        [javac] 77 errors
        [javac] 100 warnings

        Please advise
        Kindly note that I am using fedora 15 and solr 4.0 that released 13-09

        Show
        Ramzi Alqrainy added a comment - Hi Groningen, I have used your patch and I made FunctionAllGroupHeadsCollector public and when I execute this command ant dist to build , the below errors are displayed [javac] 77 errors [javac] 100 warnings Please advise Kindly note that I am using fedora 15 and solr 4.0 that released 13-09
        Hide
        Martijn van Groningen added a comment -

        Hi Ramzi, So you have 77 errors Can you send me what errors you have?

        BTW if you just want to use the patch you can just apply it and build Solr (ant clean dist). The patch should work when using group.field parameter.

        Show
        Martijn van Groningen added a comment - Hi Ramzi, So you have 77 errors Can you send me what errors you have? BTW if you just want to use the patch you can just apply it and build Solr (ant clean dist). The patch should work when using group.field parameter.
        Hide
        Martijn van Groningen added a comment -

        Updated patch. Both support multi select facets with group.truncate=true for group.field and group.func. Also added test cases for this issue in the grouping tests.

        Show
        Martijn van Groningen added a comment - Updated patch. Both support multi select facets with group.truncate=true for group.field and group.func. Also added test cases for this issue in the grouping tests.
        Hide
        Ramzi Alqrainy added a comment - - edited

        Hi Martjin,
        Kindly note that I have used #1626 (20-Sep-2011) instead of #1622 (13-Sep-2011) and every thing is working very well , thank you very much Martjin , I am happy to deal with you

        Show
        Ramzi Alqrainy added a comment - - edited Hi Martjin, Kindly note that I have used #1626 (20-Sep-2011) instead of #1622 (13-Sep-2011) and every thing is working very well , thank you very much Martjin , I am happy to deal with you
        Hide
        Martijn van Groningen added a comment -

        Thanks for testing the patch out!
        I've committed the fix for this issue.
        Trunk: 1174072
        Branch 3x: 1174055

        Show
        Martijn van Groningen added a comment - Thanks for testing the patch out! I've committed the fix for this issue. Trunk: 1174072 Branch 3x: 1174055
        Hide
        Uwe Schindler added a comment -

        Bulk close after 3.5 is released

        Show
        Uwe Schindler added a comment - Bulk close after 3.5 is released

          People

          • Assignee:
            Unassigned
            Reporter:
            Ramzi Alqrainy
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development