Michel_ VIP
Total posts: 61
17 Jun 2012 06:28

When we choose the 'Filter box show nums' option, the numbers of records are displayed. OK.

Problem, the numbers indicate the number of records** in the whole section**.

Is there an option to show instead the number of records** in the current category**?

In fact, I think if we choose the option 'Show categories of current category' (Section -> General -> Templates -> Category Index -> Properties -> Categories -> Display mode -> Show categories of current category)

this must also applied to the 'Filter box show nums' option.

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
17 Jun 2012 07:01

In fact, I think if we choose the option 'Show categories of current category' (Section -> General -> Templates -> Category Index -> Properties -> Categories -> Display mode -> Show categories of current category)

this must also applied to the 'Filter box show nums' option.

I agree but only filters has its own parameter called Filters Mode. It works independent of Records Mode. I mean you may set to show records only in current category but when filter search through whole section.

I agree that numbering is poor. Actually it should show the real number not just section summary. But here is the issue. With resources we had slowness problem on some sites. To be true on many sites. When we developed Cobalt we noticed all disabilities we had and invented new optimized structure and new style of SQL queries which already shows great results. We now within 1 second on 50 000 records in section.

Querying records is the most resources consumption query. Imagine we have 3 fields and every field is filter and every field ave 100 values. Now we run very simple query to count records. If we do calculation taking n account other filters then those calculation queries will add extra WERE expressions on every new applied filter.

We just afraid that this feature will not give much advantages if at the end we come to 3-4 seconds to run the page. Speed is our first priority. And we may even drop some features at all and give it up rather than sacrifice speed.

But if find good way to calculate records taking in account all applied filters and record mode, we will do it.


Michel_ VIP
Total posts: 61
19 Jun 2012 17:20

I agree with you.

Speed is more important. Num in filters are 'nice to have'. And we have the option to not display the numbers.

But can you tell me which file can I try to modify to test a query according to my needs ?

Just to try it.

If response time is bad, I will change Field > Filterins - Field Specific > Filter box show nums to No.


Sergey
Total posts: 13,748
19 Jun 2012 20:26

it is ib /library/php/fields/cobaltselectable.php on line 105-108

if ($this->params->get('params.filter_show_number', 1))

{

    $query->select('count(record_id) as num');

}

You can add there other conditions.

Powered by Cobalt