<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def searchFilesIndex(self, nameData, fileData, fileIndex, searchString, category="", math=False, game=False, extension=""):
 		"""Search the files index using the namedata and returns the filedata"""

		try:
			fileFile = open(fileIndex, 'rt')
		except IOError:
			self.repo.printd("Error: Unable to read index file " + self.fileIndex)
			return None, None
			
		count = 1
		for line in fileFile:
			count += 1
			try:
				if nameData[count] != None:
					#category argument
					if category in line:
						fileData[count] = line[:len(line) - 1]
					else:
						nameData[count] = None
						fileData[count] = None
					#extension argument
					if extension in line:
						fileData[count] = line[:len(line) - 1]
					else:
						nameData[count] = None
						fileData[count] = None
					#Both game and math
					if (game and math):
						if ("/games/" in line or "/math/" in line or "/science" in line):
							nameData[count] = line[:len(line) - 1]
						else:
							nameData[count] = None
					#game option switch
					elif game:
						if "/games/" in line:
							fileData[count] = line[:len(line) - 1]
						else:
							nameData[count] = None
							fileData[count] = None
					#math option switch
					elif math:
						if ("/math/" in line or "/science/" in line):
							fileData[count] = line[:len(line) - 1]
						else:
							nameData[count] = None
							fileData[count] = None
			except:
				pass
				
		#Close the file and return
		fileFile.close()
		return fileData, nameData