Ejemplo n.º 1
0
 def find(cls, q, fq, **kw):
     result = solr().raw_query(q=q,
                               fq=fq,
                               wt='json',
                               sort='score desc',
                               fl='*,score',
                               **kw)
     result = json.loads(result)
     return result
Ejemplo n.º 2
0
 def __init__(self, name, db_user, db_name, entity_table, entity_key, 
              alias_table, alias_text, alias_key):
     self.name = name
     self.entity_table = entity_table
     self.entity_key = entity_key
     self.alias_text = alias_text
     self.alias_key = alias_key
     self.conn = solr()
     self.database = Database(app.config['WEBSTORE_SERVER'],
                              db_user, db_name)
     self.alias = self.database[alias_table]
     self.entity = self.database[entity_table]
Ejemplo n.º 3
0
 def __init__(self, name, db_url, entity_table, entity_key, 
              alias_table, alias_text, alias_key):
     self.name = name
     self.entity_table = entity_table
     self.entity_key = entity_key
     self.alias_table = alias_table
     self.alias_text = alias_text
     self.alias_key = alias_key
     self.conn = solr()
     self.database, _ = URL(db_url)
     self.alias = self.database[alias_table]
     self.entity = self.database[entity_table]
Ejemplo n.º 4
0
 def __init__(self, name, db_url, entity_table, entity_key, alias_table,
              alias_text, alias_key):
     self.name = name
     self.entity_table = entity_table
     self.entity_key = entity_key
     self.alias_table = alias_table
     self.alias_text = alias_text
     self.alias_key = alias_key
     self.conn = solr()
     self.database, _ = URL(db_url)
     self.alias = self.database[alias_table]
     self.entity = self.database[entity_table]
Ejemplo n.º 5
0
def before_request():
    # HTTPConnection used by pysolr is not thread-safe.
    g.solr = solr()
Ejemplo n.º 6
0
def before_request():
    # HTTPConnection used by pysolr is not thread-safe.
    g.solr = solr()
Ejemplo n.º 7
0
 def find(cls, q, fq, **kw):
     result = solr().raw_query(q=q, fq=fq, wt='json',
             sort='score desc', fl='*,score', **kw)
     result = json.loads(result)
     return result
Ejemplo n.º 8
0
def reset():
    """ Reset the entire search index. """
    conn = solr()
    conn.delete_query('*:*')
Ejemplo n.º 9
0
def reset():
    """ Reset the entire search index. """
    conn = solr()
    conn.delete_query('*:*')