I have solved the problem by declaring the TikaEntityProcessor inside the main entity. I am sharing the correct code for information.
<dataSource name="test2" type="BinFileDataSource" />
<document>
<entity name="files" dataSource="null" rootEntity="false"
processor="FileListEntityProcessor" transformer="RegexTransformer"
baseDir="/home/shah/solr/IndexTest" fileName="\.(txt)|(pdf)|(docx)"
onError="skip"
recursive="true">
<field column="fileSize" name="size" />
<field column="fileLastModified" name="lastModified" />
<field column="file" name="id" regex="(.txt)" replaceWith=""/>
<entity dataSource="test2"
name="documentImport"
processor="TikaEntityProcessor"
url="${files.fileAbsolutePath}"
format="text">
<field column="text" name="Text" />
<entity name="item" dataSource="test1" query="select PaperID, ID, VName from ACL.Score where PaperID='${files.file}'">
<field column="PaperID" name="PaperID" />
<field column="ID" name="ID" />
<field column="VName" name="Venue" />
</entity>
</entity>
</entity>
</document>
</dataConfig>