From dbeeb2a188965840e060d2b2eddabf44df33049b Mon Sep 17 00:00:00 2001 From: epugh Date: Tue, 1 Sep 2020 09:14:39 -0400 Subject: [PATCH 1/2] reworked with a powershell indexing script --- README.md | 49 ++++++++++++++++++++++--------------------------- index.ps1 | 4 ++++ 2 files changed, 26 insertions(+), 27 deletions(-) create mode 100644 index.ps1 diff --git a/README.md b/README.md index ee0cc65..bba1ae1 100644 --- a/README.md +++ b/README.md @@ -4,43 +4,37 @@ This repository is part of the _Think Like a Relevancy Engineer_ training provid ## Steps to get up and running: - Download this repo -- Install the software (using either Docker or installing manually) +- Install Solr search engine and configuration (using either Docker or installing manually) - Index the TMDB movie data - Confirm Solr has the data - Install Postman (optional) # Download this repo -Download the zip from https://github.com/o19s/solr-tmdb/archive/master.zip +Download the zip from https://github.com/o19s/solr-tmdb/archive/master.zip, and +you will get the file `solr-tmdb-master.zip`. Unzip this file, resulting in the +directory `solr-tmdb-master`. -or clone it: -``` -git clone https://github.com/o19s/solr-tmdb.git -``` - -After you have this repo, change into the newly created directory. +After you have this download, change into the newly created directory. # Install Solr Two options exist to run Solr locally, however if neither of them will work for you, we do have a public version of this dataset deployed at http://quepid-solr.dev.o19s.com:8985/solr/ that -you can use during the class as well. +you can use during the class as well, so don't fret if your environment won't let you set up Solr! ### Docker option (recommended) If you have [Docker](https://www.docker.com/products/docker-desktop) installed and running. -``` -./docker.sh -``` + +> ./docker.sh or -``` -docker pull solr:8.4.1 -docker run -p 8983:8983 -v $(pwd)/solr_home:/opt/mysolrhome -e SOLR_HOME=/opt/mysolrhome -e INIT_SOLR_HOME=yes solr:8.4.1 -``` +> docker run -p 8983:8983 -v $(pwd)/solr_home:/opt/mysolrhome -e SOLR_HOME=/opt/mysolrhome -e INIT_SOLR_HOME=yes solr:8.4.1 + ### Local option @@ -48,11 +42,14 @@ docker run -p 8983:8983 -v $(pwd)/solr_home:/opt/mysolrhome -e SOLR_HOME=/opt/my 2. Navigate into the newly unzipped directory. -3. Run Solr pointing at the Solr Home directory included in this repo. +3. Run Solr pointing at the TMDB Solr Home directory included in this repo. + +Linux: +>bin/solr start -f -s /path/to/solr-tmdb-master/solr_home/ + +Windows 10: +>bin\solr start -f -s \path\to\solr-tmdb-master\solr_home\ -``` -bin/solr start -f -s /path/to/solr-tmdb/solr_home/ -``` Regardless of the option you choose, navigate to [http://localhost:8983/solr/](http://localhost:8983/solr/) to confirm Solr is running. @@ -66,15 +63,13 @@ unzip tmdb_solr.json.zip Then send the unzipped `tmdb_solr.json` into Solr. -``` -./index.sh -``` +Linux: +> ./index.sh -or +Windows 10: +> powershell index.ps1 -``` -curl 'http://localhost:8983/solr/tmdb/update?commit=true' --data-binary @tmdb_solr.json -H 'Content-type:application/json' -``` +_If you get a permissions error, just open the index.ps1 file and copy and paste the contents into your Powershell console_ You are indexing a *big 100 mb file*, so this will take up to five minutes! diff --git a/index.ps1 b/index.ps1 new file mode 100644 index 0000000..aac97db --- /dev/null +++ b/index.ps1 @@ -0,0 +1,4 @@ +# Powershell script for Windows 10 and above to index the TMDB JSON file. + +$data = Get-Content 'tmdb_solr_file.json' +Invoke-WebRequest -Method POST -Uri 'http://localhost:8983/solr/tmdb/update' -ContentType 'application/json' -UseBasicParsing -Body $data From faaf0bb5324352f60fe68b8f0485bf90d06682d1 Mon Sep 17 00:00:00 2001 From: Nathan Day Date: Tue, 8 Sep 2020 08:06:41 -0400 Subject: [PATCH 2/2] use index pattern for dockers too --- README.md | 7 +++---- docker.ps1 | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100755 docker.ps1 diff --git a/README.md b/README.md index bba1ae1..a2d9f8e 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,11 @@ you can use during the class as well, so don't fret if your environment won't le If you have [Docker](https://www.docker.com/products/docker-desktop) installed and running. - +Linux: > ./docker.sh -or - -> docker run -p 8983:8983 -v $(pwd)/solr_home:/opt/mysolrhome -e SOLR_HOME=/opt/mysolrhome -e INIT_SOLR_HOME=yes solr:8.4.1 +Windows: +> powershell docker.ps1 ### Local option diff --git a/docker.ps1 b/docker.ps1 new file mode 100755 index 0000000..6b5c7de --- /dev/null +++ b/docker.ps1 @@ -0,0 +1,2 @@ + +docker run -p 8983:8983 -v ${PWD}/solr_home:/opt/mysolrhome -e SOLR_HOME=/opt/mysolrhome -e INIT_SOLR_HOME=yes solr:8.4.1