-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new data * update index script to actually wipe an existing index * Powershell fixes * unzip logic to index.sh Co-authored-by: = <[email protected]>
- Loading branch information
1 parent
3c510e9
commit 7b841dc
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
# Powershell script for Windows 10 and above to index the TMDB JSON file. | ||
|
||
$data = Get-Content 'tmdb_solr_file.json' | ||
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>' -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_data/tmdb_solr.json' | ||
Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -ContentType 'application/json' -UseBasicParsing -Body $data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
#!/bin/bash | ||
if [ ! -f ./tmdb_solr.json ]; then | ||
unzip tmdb_solr.json.zip | ||
fi | ||
|
||
# delete (or wipe) the tmdb index and reindex | ||
curl http://localhost:8983/solr/tmdb/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8' | ||
|
||
curl http://localhost:8983/solr/tmdb/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8' | ||
|
||
curl 'http://localhost:8983/solr/tmdb/update?commit=true' --data-binary @tmdb_solr.json -H 'Content-type:application/json' |
Binary file not shown.