예제 #1
0
def tempSearchQuery(index, query, settings, lang):
	if not lang:
		lang = settings.get('lang')

	searchEngine = SearchEngine(index, getStopWords(lang))
	fca = FCASearchEngine(searchEngine, index, settings)
	searchResults = fca.search(query, lang)
	return searchResults
예제 #2
0
	def search(self, query):
		database = DATABASES_FOLDER + self.databaseName + '/'
		settings = Settings(database + SETTINGS_FILE)
		index = Index(database, settings)
		searchEngine = SearchEngine(index, getStopWords())
		fca = FCASearchEngine(searchEngine, index, settings)
		searchResults = fca.search(query, True) # nostemsearch
		return [tuple(map(self.normalizeQuery, x['words'])) for x in searchResults['specialization']][:self.maxSpec]
예제 #3
0
def searchQuery(databaseName, query, lang, stopwatch = None):
	index, settings = getIndexAndSettings(databaseName)
	if not lang:
		lang = settings.get('lang')

	searchEngine = SearchEngine(index, getStopWords(lang))
	fca = FCASearchEngine(searchEngine, index, settings)
	searchResults = fca.search(query, lang)
	return searchResults
예제 #4
0
 def search(self, query):
     database = DATABASES_FOLDER + self.databaseName + '/'
     settings = Settings(database + SETTINGS_FILE)
     index = Index(database, settings)
     searchEngine = SearchEngine(index, getStopWords())
     fca = FCASearchEngine(searchEngine, index, settings)
     searchResults = fca.search(query, True)  # nostemsearch
     return [
         tuple(map(self.normalizeQuery, x['words']))
         for x in searchResults['specialization']
     ][:self.maxSpec]