My route tag filters not giving correct results

My route file looks like :

collections:
  /:
    permalink: /en/{slug}/
    template: index
    filter: 'tag:-in'
  /en/:
    permalink: /en/{slug}/
    template: en
    filter: 'tag:en'
  /in/:
    permalink: /in/{slug}/
    template: in
    filter: 'tag:in'

My use-case was like

  1. https://kahaniguru.com/ should show article in english
  2. https://kahaniguru.com/in/ should show article in hindi
  3. https://kahaniguru.com/en/ should show article in english
    But for my surprise, the 3rd case is showing no result.

Collections are a cascade - they are processed in order and each post can only belong to one collection.
So your first rule grabs all posts which don’t have the “in” tag, which I assume included all the ones with the “en” tag and then there are no posts left for the second collection.

You’re probably looking for channels instead of collections for at least one of these rules: