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
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]
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
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]