Since no one has been able to provide an answer, here's an alternative approach. Instead of using makeidx and xindy this uses glossaries-extra and bib2gls. This means that instead of using \index the terms that need indexing must all be defined in a .bib file.
For example, the file entries.bib contains:
% Encoding: UTF-8
@index{test}
@index{foo}
@index{bar,
name={bar},
parent={foo}
}
The document test.tex is:
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage[record, % using bib2gls
nostyles,% don't load the default styles
stylemods={bookindex},% load glossary-bookindex.sty
style=bookindex% use the bookindex style
]{glossaries-extra}
\GlsXtrLoadResources[
src={entries}, % data in entries.bib
sort={en}% sort by this language tag (en = English)
]
\begin{document}
\Gls{test}.\glsadd{bar}
\printunsrtglossary[title=Index]
\end{document}
The document build is:
pdflatex test
bib2gls -g test
pdflatex test
pdflatex test
(Replace pdflatex with xelatex etc as appropriate. The third instance just makes sure that the PDF bookmarks are up-to-date.)
The result is:

The red text indicates a hyperlink.
If you forget the -g (--group) switch, you won't get the group headings:

Notes:
@index first identifies the label used to reference the term (analogous to BibTeX where the label is used in \cite). This will also be the text used in the index and by commands like \gls unless overridden by the name field.
- The label can't contain any special characters, commas or spaces. When used with
inputenc, the label also can't contain any non-ASCII characters either, but since you're using Persian I'm guessing that you're probably using fontspec with XeLaTeX or LuaLaTeX.
\gls{label} displays the term and creates a hyperlink to the relevant line in the index. \Gls converts the first letter to upper case. You can get the plural forms with \glspl and \Glspl.
\glsadd{label} just adds the term to the index without producing any text (and therefore no hyperlink).
- You don't need to specify the language in
sort if it matches the document language. I've used sort=en because the document doesn't include any language information.
Here's another example. File entries.bib now contains:
% Encoding: UTF-8
@index{bird}
@index{duck,
name={duck},
parent={bird}
}
@index{goose,
name={goose},
plural={geese},
parent={bird}
}
@index{wildfowl,
alias={bird}
}
The document test.tex contains:
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage[record, % using bib2gls
nostyles,% don't load the default styles
stylemods={bookindex},% load glossary-bookindex.sty
style=bookindex% use the bookindex style
]{glossaries-extra}
\GlsXtrLoadResources[
src={entries}, % data in entries.bib
sort={en}% sort by this language tag
]
\begin{document}
\Glspl{goose} and \glspl{duck}. \Gls{wildfowl} links to `bird' not
`wildfowl' in the index.
\printunsrtglossary[title=Index]
\end{document}
The result is now:

\LetLtxMacro, instead of\let. A detailed description of\LetLtxMacrocan be found at this question at closed square root symbol. – Peter Grill Nov 10 '12 at 21:41\subsubitemis written inside the argument of\hypertarget. Probably Xindy gets confused by the two!it finds in the same entry. – egreg Nov 11 '12 at 10:31