expungeDeletes wont' do the trick for you, it purges documents in segments with > 10% deleted docs so you'll still have documents.
I'd push back on "the requirement is to show facets with 0 count as disabled." Why? What use-case is satisfied here? Effectively this is saying "For my query, show me possible values that have no hits for that query". Optimize is a very costly operation and to really get this behavior you'll need to run it _every_ time the index changes. You really can't afford to run it for every update, so there'll be a period of time when you will still get these facets. Eventually you won't be displaying zero-count facets anyway, assuming that you have room for, say, only 10 facets and sort by frequency. If your index changes only periodically (say once a day) that may be fine. But more often than that and you won't be able to satisfy the requirement anyway. My point is that requirements like this are often created without understanding the consequences and cause a lot of effort to be expended without a good purpose. See: https://lucidworks.com/2017/10/13/segment-merging-deleted-documents-optimize-may-bad/ Best, Erick On Thu, Apr 12, 2018 at 10:32 PM, girish.vignesh <girish.vign...@gmail.com> wrote: > mincount will fix this issue for sure. I have tried that but the requirement > is to show facets with 0 count as disabled. > > I think I left with only 2 options. Either go with expungeDelets with update > URL or use optimize in a scheduler. > > Regards, > Vignesh > > > > -- > Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html