core icon indicating copy to clipboard operation
core copied to clipboard

Entries column shows zero for some content types

Open bryanboza opened this issue 9 years ago • 4 comments

We are showing some content types entries in cero, this because we remplace the View word by the number of contents, but we are inconsistent with this data

Expected Behavior

We should show the real number of entries

Current Behavior

We replaced the View with the number of elements for that Content Type, but some content types shows 0.

SC: https://screencast.com/t/96WmSz8fXVv

Steps to Reproduce (for bugs)

  1. Login as admin
  2. Go to content types

Your Environment

Tested in the last master // Chrome

bryanboza avatar Jun 14 '17 18:06 bryanboza

we need to use an es agg query to get this data.

wezell avatar Jun 16 '17 13:06 wezell

Agg query was already being used. The problem is it returns the top tep by default (Figure that out after reading the doc). Agg query needs to be altered like this:

{ "aggs" : { "entries" : { "terms" : { "field" : "contentType", "size" : 0 } } }, size:0}

for it to return them all instead of the top ten.

dsilvam avatar Jun 16 '17 22:06 dsilvam

"By default, the terms aggregation will return the buckets for the top ten terms ordered by the doc_count. One can change this default behaviour by setting the size parameter."

"If set to 0, the size will be set to Integer.MAX_VALUE"

Quoted from: https://www.elastic.co/guide/en/elasticsearch/reference/2.0/search-aggregations-bucket-terms-aggregation.html

dsilvam avatar Jun 16 '17 22:06 dsilvam

Passed QA. Checked that existing Entries match to existing content types Verified that adding contents to a specific content type are reflected to in the Entries column Verified that deleting contents from a specific content type are reflected to in the Entries column image

Tested locally using the following environments: Upgrade from dotcms_3.6 with client dataset (db and assets) to master branch / commit 4fd490584297bafd0ad55bc7896df872c5ba1ffa Ubuntu 14.04.1 / Postgres 9.3.5 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8

shaydotcms avatar Jun 19 '17 18:06 shaydotcms