Exemplo n.º 1
0
 def __init__(self, model=None):
     self.model = model
     self.low_mark = 0
     self.high_mark = None
     self.where = SearchNode()
     self.fq = SearchNode()
     self.ordering = []
     self.facets = []
     self.stats = []
     self.stats_facets = []
     self.fields = ['*', 'score']
     self.extra_params = {}
     self.annotations = {}
     self.frange = []
     self.handler = conf.get('handlers.default')
Exemplo n.º 2
0
 def handle_noargs(self, host=None, handler=None, core=None,
         swap_core=None, core_admin=None, **kwargs):
     if (None, None, None, None, None) == (host, handler, core, swap_core, core_admin):
         """
         If any args are passed, all args are required, otherwise we'll just
         use the config.
         """
         from brushfire.core.settings import configuration as conf
         
         method = conf.get('index.method', 'dih')
         if method != 'dih':
             raise CommandError, "This command only works with the " \
                                 "dataimporthandler (dih) index method"
         host = conf.get('host')
         handler = conf.get('index.dih.handler', '/dataimport')
         core = conf.get('index.dih.core')
         swap_core = conf.get('index.dih.swap_cores_on_complete', False)
         core_admin = conf.get('cores.admin')
     
     reindex.reindex(host, handler, core, swap_core, core_admin, self.stderr)
Exemplo n.º 3
0
from django.conf import settings
from django.utils.importlib import import_module

from brushfire.core.driver import Solr
from brushfire.core.settings import configuration as conf
from brushfire.core.query import *
from brushfire.core import models

driver = conf.get('driver', False, None)
if driver:
    driver = import_module(driver)
else:
    driver = Solr

solr = conf.configure_solr(driver)
conf.set_solr(solr)