예제 #1
0
from cloudmining import CloudMiningApp

# create a FSphinxClient from the configuration file
cl = FSphinxClient.FromConfig('config/sphinx_client.py')

# create similarity search client
sim_cl = SimClient.FromConfig('config/simsearch_client.py')

# create a new CloudMining web application
app = CloudMiningApp(autoreload=True)

# set the fsphinx client of the webapp
app.set_fsphinx_client(cl)

# same for similarity search
app.set_sim_client(sim_cl)

# if cl has a search cache preload it
app.set_preload_cache_file('data/redis-cache.dat')

# some more options which can be set
app.set_debug(True)  # also web.config.debug
app.set_template_caching(False)  # also web.config.template_caching
app.set_flush_cache_on_startup(True)

# what sorting options are shown (key must match cl sort options)
app.set_ui_sort_by(
    dict(key='cit', description='number of citations'),
    dict(key='rel', description='relevance'),
    dict(key='dat', description='year')
)
예제 #2
0
from cloudmining import CloudMiningApp

# create a FSphinxClient from the configuration file
cl = FSphinxClient.FromConfig('config/sphinx_client.py')

# create similarity search client
sim_cl = SimClient.FromConfig('config/simsearch_client.py')

# create a new CloudMining web application
app = CloudMiningApp(autoreload=True)

# set the fsphinx client of the webapp
app.set_fsphinx_client(cl)

# same for similarity search
app.set_sim_client(sim_cl)

# if cl has a search cache preload it
app.set_preload_cache_file('data/redis-cache.dat')

# some more options which can be set
app.set_debug(True)  # also web.config.debug
app.set_template_caching(False)  # also web.config.template_caching
app.set_flush_cache_on_startup(True)

# what sorting options are shown (key must match cl sort options)
app.set_ui_sort_by(dict(key='cit', description='number of citations'),
                   dict(key='rel', description='relevance'),
                   dict(key='dat', description='year'))

# you can reorder the facets and change default look here