Skip to content

Commit

Permalink
Merge pull request #3318 from freelawproject/stop-indexing-parties-in…
Browse files Browse the repository at this point in the history
…-solr

Stop indexing docket parties in Solr
  • Loading branch information
mlissner authored Oct 30, 2023
2 parents f429231 + 36c3826 commit e01ccc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 59 deletions.
59 changes: 0 additions & 59 deletions cl/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,33 +1000,6 @@ def as_search_list(self):
}
)

# Parties, attorneys, firms
if self.pk not in [
# Block mega cases that are too big
6245245, # J&J Talcum Powder
4538381, # Ethicon, Inc. Pelvic Repair System
4715020, # Katrina Canal Breaches Litigation
]:
out.update(
{
"party_id": set(),
"party": set(),
"attorney_id": set(),
"attorney": set(),
"firm_id": set(),
"firm": set(),
}
)
for p in self.prefetched_parties:
out["party_id"].add(p.pk)
out["party"].add(p.name)
for a in p.attys_in_docket:
out["attorney_id"].add(a.pk)
out["attorney"].add(a.name)
for f in a.firms_in_docket:
out["firm_id"].add(f.pk)
out["firm"].add(f.name)

# Do RECAPDocument and Docket Entries in a nested loop
for de in self.docket_entries.all().iterator():
# Docket Entry
Expand Down Expand Up @@ -1617,38 +1590,6 @@ def get_docket_metadata(self):
"court_citation_string": docket.court.citation_string,
}
)

# Parties, Attorneys, Firms
out.update(
{
"party_id": set(),
"party": set(),
"attorney_id": set(),
"attorney": set(),
"firm_id": set(),
"firm": set(),
}
)

if docket.pk in [
6245245, # J&J Talcum Powder
4538381, # Ethicon, Inc. Pelvic Repair System
4715020, # Katrina Canal Breaches Litigation
]:
# Skip the parties for mega cases that are too big to
# pull from the DB. Sorry folks.
return out

for p in docket.prefetched_parties:
out["party_id"].add(p.pk)
out["party"].add(p.name)
for a in p.attys_in_docket:
out["attorney_id"].add(a.pk)
out["attorney"].add(a.name)
for f in a.firms_in_docket:
out["firm_id"].add(f.pk)
out["firm"].add(f.name)

return out

def as_search_dict(self, docket_metadata=None):
Expand Down
12 changes: 12 additions & 0 deletions cl/search/tests/tests_es_recap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,10 @@ async def test_available_only_field(self) -> None:
# API
await self._test_api_results_count(params, 1, "available_only")

@unittest.skipIf(
tests_running_over_solr,
"Skip in SOlR due to we stopped indexing parties",
)
async def test_party_name_filter(self) -> None:
"""Confirm party_name filter works properly"""
params = {
Expand All @@ -1502,6 +1506,10 @@ async def test_party_name_filter(self) -> None:
# API, 2 result expected since RECAPDocuments are not grouped.
await self._test_api_results_count(params, 2, "party_name")

@unittest.skipIf(
tests_running_over_solr,
"Skip in SOlR due to we stopped indexing parties",
)
async def test_atty_name_filter(self) -> None:
"""Confirm atty_name filter works properly"""
params = {"type": SEARCH_TYPES.RECAP, "atty_name": "Debbie Russell"}
Expand Down Expand Up @@ -1586,6 +1594,10 @@ async def test_docket_child_documents(self) -> None:
params, 4, "docket_number + available_only"
)

@unittest.skipIf(
tests_running_over_solr,
"Skip in SOlR due to we stopped indexing parties",
)
async def test_advanced_queries(self) -> None:
"""Confirm advance queries works properly"""
# Advanced query string, firm
Expand Down

0 comments on commit e01ccc7

Please sign in to comment.