You can manually enter the format you want to output the field options with in the settings for the search filter, mixing the placeholders, so that you can use for example %%NAME%% (%%COUNT%%) as shown in the screenshot, together with the results.
Nigel, thank you for the prompt response.
But, I know how to create the counts.
The question was, how can I have these counts updated, despite having the "Show only filter options that would produce results" option turned OFF. When I have this option ON, the updating of counts during AJAX refresh works, when it is OFF, it doesn't.
I would like to have:
1. AJAX automatic refresh
2. counts updated with each refresh
3. All options displayed, with count=0, too
OK, thanks for the clarification, I understand you want the filter values to update to be consistent with the current search results, but rather than have options that would produce no results disappear you want them to continue to be displayed, but with a zero count.
This would be possible with the legacy Views editor, but the same options did not get implemented in the View block.
If you see the screenshot of settings that are available in the Custom Search Settings of a legacy View when you opt to choose individual settings manually, you have the option of whether to hide unavailable options or whether to disable them (but continue to show them).
If you wanted to avail of that setting I'm afraid you would need to recreate the same View using the legacy editor rather than the block editor.
If you want to try that, although the UI is different the concepts are the same.
Go to Toolset > Settings and make sure that the legacy editor is available (you'll probably want the option to show both), and then go to Toolset > Views to make a new View using the legacy editor. When finished you can insert this existing View using the View block.
Actually, before you go down that route, we have an API filter where it is possible to override the View settings.
I haven't tested it to see that it would work in this scenario, where the settings are missing from the View block, but I think it should if you want to give it a try with your existing View made using Blocks.
Nigel, thank you for very informative answer. It taught me a lot.
And it works as you said. But, I didn't mention I needed the options with (0) not just to show up, but also be check-able.
It is because I need this custom filter to work on the view output (in its regular function), but also to serve as a configurator for email notifications when a new record appears that fits the criteria. This means, I want the users to be able to select also the options that make no difference in that moment but serve as a setting for the future.
Sorry for not explaining this immediately. Can it be done?
Unfortunately the logic of this is all tied together, the %%COUNT%% placeholder will only update if you have the option active to only show filter values that will produce results, and there the option is to hide options that would produce results or to disable them.
However, I expect that the options are disabled simply by adding the disable attribute to them.
So you should be able to add a little JavaScript snippet that strips the disable attribute from any of the options which have it.