Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Term panel with mean mode should display 0 other values #320

Open
krystiankaluzny opened this issue Apr 4, 2018 · 0 comments
Open

Term panel with mean mode should display 0 other values #320

krystiankaluzny opened this issue Apr 4, 2018 · 0 comments

Comments

@krystiankaluzny
Copy link

krystiankaluzny commented Apr 4, 2018

Hi,
I created term panel with mean mode and I check Other, like this:
term_panel_screenshow
And it looks like this:
term_panel_view
I expect that Other values bar displays 0 value but it isn't

After some investigation i found that lines in terms/module.js

var sum = 0;
$scope.hits = results.response.numFound;

...

if ($scope.panel.field && $scope.fields.typeList[$scope.panel.field] && $scope.fields.typeList[$scope.panel.field].schema.indexOf("T") > -1) {
          $scope.hits = sum;
}

...

$scope.data.push({label:'Other values',
          // data:[[k+1,results.facets.terms.other]],meta:"other",color:'#444'});
          // TODO: Hard coded to 0 for now. Solr faceting does not provide 'other' value.
          data:[[k+1,$scope.hits-sum]],meta:"other",color:'#444'});

So $scope.hits - sum = $scope.hits cause sum is equals 0

scope.fields.typeList based on /admin/luke?numTerms=0&wt=json respons.
For user_type_str it looks like this

"fields" : {
    "user_type_str": {
      "type": "string",
      "schema": "I-SD-----OF-----l",
      "index": "ITS------OF------",
      "docs": 224736
    },
   ...
},
"info": {
    "key": {
      "T": "Tokenized",
    },
   ...
}

My user_type_str configuration from managed-schema

<field name="user_type_str" type="string" stored="true"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true"/>

The question is what is the purpose of checking if schema contains "T"?
And if there is some reason for it, how should I change my schema to work with it?
Maybe setting data should set 0 explicity:
data:[[k+1, 0]],meta:"other",color:'#444'}

I use Banana 1.6.0
Note that using count mode works fine couse sum == $scope.hits

@krystiankaluzny krystiankaluzny changed the title Term panel with mean mode - other should be 0 Term panel with mean mode should display 0 other values Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant