How to make a count distinct in Banana Hits Panel

413 Views Asked by At

in the Banana version of March 2016 the Hits Panel has new statistics functions (like min, max, mean, stddev, etc.) which are really useful than the single count function there was before. But the function count distinct doesn't exist yet :-(

Does someone knows what part of code to update in the 'module.js' file to add a 'count distinct' ? I'm using a Solr version is 4.4.

1

There are 1 best solutions below

1
On

There are two parts to be updated:

  • module.js: append &stats.calcdistinct=true to the variable facets = '&stats=true&...' (around line #132 depending on your branch)
  • editor.html: add countDistinct to panel.mode options array, i.e. f for f in ['count','max','min','sum','countDistinct']