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
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]
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]
def before_request(): # HTTPConnection used by pysolr is not thread-safe. g.solr = solr()
def reset(): """ Reset the entire search index. """ conn = solr() conn.delete_query('*:*')