When there are a lot of tokens that can match a prefix Typesense selects the N most probable words that matches the filter. When filter changes that list of word candidates change so can produce a different count. You can set a higher value for max_candidates parameter to adjust this behaviour.