search filetype:"txt" returns .bat .MD .yml .scss .policy ...

(from github.com/yuatasia)
where is the logic(code) defining a file type in fess system?
I want the search results to be precise that only files with the specified extension be returned.
(.txt files in this case)
also want to enable like filetype:“bat” but have no clue how to add that.
anyone?

(from github.com/marevol)
See app.xml.