Apache Tika uses language profiles from Optimaize Language Detector, which are based on statistical n-gram models. If Farsi isn't recognised, it typically means that:
The text sample is too short or ambiguous, or
The language profile for Farsi (fa) is missing
You could try;
use a longer or more diverse sample in Farsi
make sure you are using the OptimizeLangDetector, and
ensure you're using a recent Tika version