コード例 #1
0
 def __init__(self, main_query, offset, limit, type=None, length=None):
     super(SolrList, self).__init__()
     self.main_query = main_query
     self.offset = offset
     self.limit = limit
     self.type = type
     self._item_cache = []
     if self.type == 'o':
         self.conn = sunburnt.SolrInterface(
             settings.SOLR_OPINION_URL,
             mode='r',
         )
     elif self.type == 'oa':
         self.conn = sunburnt.SolrInterface(
             settings.SOLR_AUDIO_URL,
             mode='r',
         )
     elif self.type == 'd':
         self.conn = sunburnt.SolrInterface(
             settings.SOLR_RECAP_DOCKET_URL,
             mode='r',
         )
     elif self.type == 'p':
         self.conn = sunburnt.SolrInterface(
             settings.SOLR_PEOPLE_URL,
             mode='r',
         )
     self._length = length
コード例 #2
0
ファイル: views.py プロジェクト: zayedmohamed/courtlistener
def faq(request):
    """Loads the FAQ page"""
    scraped_court_count = Court.objects.filter(
        in_use=True, has_opinion_scraper=True).count()
    conn = sunburnt.SolrInterface(settings.SOLR_OPINION_URL, mode='r')
    response = conn.raw_query(
        **search_utils.build_total_count_query()).execute()
    total_opinion_count = response.result.numFound
    return contact(
        request,
        template_path='faq.html',
        template_data={
            'scraped_court_count': scraped_court_count,
            'total_opinion_count': total_opinion_count,
        },
        initial={'subject': 'FAQs'},
    )
コード例 #3
0
 def __init__(self, stdout=None, stderr=None, no_color=False):
     super(Command, self).__init__(stdout=None, stderr=None, no_color=False)
     self.g = nx.Graph()
     self.conn = sunburnt.SolrInterface(settings.SOLR_OPINION_URL, mode='r')
     self.update_count = 0