Skip to content

Commit

Permalink
update index script to actually wipe an existing index
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancday committed Dec 29, 2020
1 parent 437cd74 commit a2f513f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Powershell script for Windows 10 and above to index the TMDB JSON file.

# 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 '<commit/>' -ContentType 'text/xml; charset=utf-8'


$data = Get-Content 'tmdb_solr_file.json'
Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -ContentType 'application/json' -UseBasicParsing -Body $data
5 changes: 5 additions & 0 deletions index.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash

# 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'

0 comments on commit a2f513f

Please sign in to comment.