本文整理汇总了Python中search.Search.get方法的典型用法代码示例。如果您正苦于以下问题:Python Search.get方法的具体用法?Python Search.get怎么用?Python Search.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search.Search
的用法示例。
在下文中一共展示了Search.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: search
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import get [as 别名]
def search(term=''):
fileConfig('config/logging.conf')
prop = PropertyUtil('config/application.conf')
logger = logging.getLogger(__name__)
topics = None
json_data = {}
try:
logger.info('Term = {0}'.format(term))
if prop is not None:
logger.info('Index Name = {0}'.format(prop.elasticSearchIndexName))
search = Search(prop , logger )
if term != '':
data = search.get(term)
json_data = json.dumps(data)
except Exception , error:
logger.error('Exception occurred - {0}'.format(str(error)))
示例2: get_tfidf
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import get [as 别名]
def get_tfidf(term):
fileConfig('config/logging.conf')
prop = PropertyUtil('config/application.conf')
logger = logging.getLogger(__name__)
json_data = {}
try:
logger.info('Term = {0}'.format(term))
if prop is not None:
logger.info('Index Name = {0}'.format(prop.elasticSearchIndexName))
search = Search(prop , logger )
if term != '':
data = search.get(term)
if data is not None and len(data) > 0:
lingo = LingoClustering(data)
json_data = json.dumps(lingo.cluster_label_induction())
except Exception , error:
logger.error('Exception occurred - {0}'.format(str(error)))
示例3: get_lda
# 需要导入模块: from search import Search [as 别名]
# 或者: from search.Search import get [as 别名]
def get_lda(term):
fileConfig('config/logging.conf')
prop = PropertyUtil('config/application.conf')
logger = logging.getLogger(__name__)
topics = None
json_data = {}
try:
logger.info('Term = {0}'.format(term))
if prop is not None:
logger.info('Index Name = {0}'.format(prop.elasticSearchIndexName))
search = Search(prop , logger )
if term != '':
data = search.get(term)
if data is not None and len(data) > 0:
topics = TopicAnalyzer(data , logger)
json_data = topics.get_lda()
except Exception , error:
logger.error('Exception occurred - {0}'.format(str(error)))