Exemple #1
0
    def match_on_citation(self, citation):
        """Attempt to identify the item referred to by the citation."""
        main_params = {
            "fq": [
                "status:Precedential",
                'citation:("%s"~5)' % citation.base_citation(),
            ],
            "caller":
            "citation.add_parallel_citations",
        }

        if citation.year:
            start_year = end_year = citation.year
        else:
            start_year, end_year = get_years_from_reporter(citation)
        main_params["fq"].append("dateFiled:%s" %
                                 build_date_range(start_year, end_year))

        if citation.court:
            main_params["fq"].append("court_exact:%s" % citation.court)

        # Query Solr
        return self.conn.query().add_extra(**main_params).execute()
    def match_on_citation(self, citation):
        """Attempt to identify the item referred to by the citation."""
        main_params = {
            'fq': [
                'status:Precedential',
                'citation:("%s"~5)' % citation.base_citation(),
            ],
            'caller': 'citation.add_parallel_citations',
        }

        if citation.year:
            start_year = end_year = citation.year
        else:
            start_year, end_year = get_years_from_reporter(citation)
        main_params['fq'].append(
            'dateFiled:%s' % build_date_range(start_year, end_year)
        )

        if citation.court:
            main_params['fq'].append('court_exact:%s' % citation.court)

        # Query Solr
        return self.conn.raw_query(**main_params).execute()
Exemple #3
0
    def match_on_citation(self, citation):
        """Attempt to identify the item referred to by the citation."""
        main_params = {
            'fq': [
                'status:Precedential',
                'citation:("%s"~5)' % citation.base_citation(),
            ],
            'caller':
            'citation.add_parallel_citations',
        }

        if citation.year:
            start_year = end_year = citation.year
        else:
            start_year, end_year = get_years_from_reporter(citation)
        main_params['fq'].append('dateFiled:%s' %
                                 build_date_range(start_year, end_year))

        if citation.court:
            main_params['fq'].append('court_exact:%s' % citation.court)

        # Query Solr
        return self.conn.raw_query(**main_params).execute()