Skip to content

Commit

Permalink
Merge pull request #434 from peviitor-ro/fix
Browse files Browse the repository at this point in the history
Fixed v0/cleanjobs
  • Loading branch information
ale23yfm authored Nov 17, 2024
2 parents 4d4d86a + 969e0a7 commit fe271ce
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions v0/cleanjobs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@

// Step 1: Get the count of jobs for the given company
$countCommand = '/select';

$countQS = '?';
$countQS .= 'q=hiringOrganization.name:"';
$countQS .= rawurlencode($company);
$countQS .= '"&';
$countQS .= 'wt=json';
$countQS .= '&';
$countQS .= 'rows=0';

$countQS = '?q=' . rawurlencode('hiringOrganization.name:"' . $company . '"') . '&wt=json&rows=0';
$countUrl = 'http://' . $server . '/solr/' . $core . $countCommand . $countQS;

try {
Expand All @@ -47,19 +39,10 @@

// Step 2: Delete the jobs
$deleteCommand = '/update';

$qs = '?';
$qs .= '_=1617366504771';
$qs .= '&';
$qs .= 'commitWithin=1000';
$qs .= '&';
$qs .= 'overwrite=true';
$qs .= '&';
$qs .= 'wt=json';

$qs = '?commit=true&wt=json';
$deleteUrl = 'http://' . $server . '/solr/' . $core . $deleteCommand . $qs;

$deleteData = json_encode(['delete' => ['query' => 'hiringOrganization.name:"' . rawurlencode($company) . '"']]);
$deleteData = json_encode(['delete' => ['query' => 'hiringOrganization.name:"' . $company . '"']]);

$options = array(
'http' => array(
Expand Down

0 comments on commit fe271ce

Please sign in to comment.