Skip to content

Commit

Permalink
Powershell fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
worleydl committed Jan 11, 2021
1 parent a2f513f commit dba8bc7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Powershell script for Windows 10 and above to index the TMDB JSON file.

if (![System.IO.File]::Exists('tmdb_data/tmdb_solr.json')) {
echo 'Extracting TMDB archive'
Expand-Archive -DestinationPath tmdb_data 'tmdb_solr.json.zip'
}

# delete (or wipe) the tmdb index and reindex
Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -Body '<delete><query>*:*</query></delete>' -Content-type 'text/xml; charset=utf-8'
Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -Body '<delete><query>*:*</query></delete>' -ContentType 'text/xml; charset=utf-8'

Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -Body '<commit/>' -ContentType 'text/xml; charset=utf-8'


$data = Get-Content 'tmdb_solr_file.json'
$data = Get-Content 'tmdb_data/tmdb_solr.json'
Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -ContentType 'application/json' -UseBasicParsing -Body $data

1 comment on commit dba8bc7

@epugh
Copy link
Member

@epugh epugh commented on dba8bc7 Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Please sign in to comment.