diff --git a/README.md b/README.md index af232c0..9ceddd3 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ Windows: 2. Navigate into the newly unzipped directory. -3. Run Solr pointing at the TMDB Solr Home directory included in this repo. +3. Open `/path/to/solr-tmdb-master/solr_home/tmdb/conf/solrconfig.xml` and change the path to include the extra libraries located in `/path/to/solr-tmdb-master/docker/lib`. + +4. Run Solr pointing at the TMDB Solr Home directory included in this repo. Linux/OSX: >bin/solr start -f -s /path/to/solr-tmdb-master/solr_home/ @@ -53,7 +55,7 @@ Windows: Regardless of the option you choose, navigate to [http://localhost:8983/solr/](http://localhost:8983/solr/) to confirm Solr is running. # Index TMDB movies -We have a movie data corpus sourced from The Movie Database (similar data to IMDB (Internet Movie Database). +We have a movie data corpus sourced from The Movie Database, similar data to IMDB (Internet Movie Database). Linux/OSX: > ./index.sh diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8e70067 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' +services: + solr: + container_name: solr + build: ./docker + ports: + - "8983:8983" + environment: + - SOLR_OPTS=-XX:-UseLargePages + - SOLR_HEAP=800m + - SOLR_HOME=/opt/mysolrhome + - INIT_SOLR_HOME=yes + volumes: + - ./solr_home:/opt/mysolrhome diff --git a/docker.ps1 b/docker.ps1 index b52b617..b71adbd 100755 --- a/docker.ps1 +++ b/docker.ps1 @@ -1,2 +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.11.1 +docker-compose up -d diff --git a/docker.sh b/docker.sh index 9c260e9..cb909cc 100755 --- a/docker.sh +++ b/docker.sh @@ -6,4 +6,4 @@ if [ "$(uname -s)" == 'Linux' ]; then sudo chown -R 8983:8983 solr_home fi -docker run -p 8983:8983 -v "${PWD}/solr_home:/opt/mysolrhome" -e SOLR_HOME=/opt/mysolrhome -e INIT_SOLR_HOME=yes solr:8.11.1 +docker-compose up -d diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..c3c486b --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,14 @@ +FROM solr:8.11.1 + +# produced by building locally your Solr +#FROM apache/solr:9.0.0-SNAPSHOT + +# produced by Apache Solr project +#FROM apache/solr-nightly:9.0.0-SNAPSHOT + +# This is required by Solr 9, but not in Solr 8! +#RUN mkdir /var/solr/data + + +COPY ./lib/querqy-solr-5.1.lucene810.0-jar-with-dependencies.jar /opt/querqy/lib/ +COPY ./lib/querqy-regex-filter-1.1.0-SNAPSHOT.jar /opt/querqy/lib/ \ No newline at end of file diff --git a/solr-postman-collection.json b/solr-postman-collection.json index a47e24b..f398a7c 100644 --- a/solr-postman-collection.json +++ b/solr-postman-collection.json @@ -1531,6 +1531,42 @@ }, "response": [] }, + { + "name": "4-Add Querqy boost rule", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"class\": \"querqy.solr.rewriter.commonrules.CommonRulesRewriterFactory\",\n \"config\": {\n \"rules\" : \"action =>\\nUP(100): * genres:action\"\n }\n}\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{solr_host}}/solr/tmdb/querqy/rewriter/common_rules?action=save", + "host": [ + "{{solr_host}}" + ], + "path": [ + "solr", + "tmdb", + "querqy", + "rewriter", + "common_rules" + ], + "query": [ + { + "key": "action", + "value": "save" + } + ] + } + }, + "response": [] + }, { "name": "6-LTR", "request": { diff --git a/solr_home/tmdb/conf/schema.xml b/solr_home/tmdb/conf/schema.xml index a94d983..25627f3 100644 --- a/solr_home/tmdb/conf/schema.xml +++ b/solr_home/tmdb/conf/schema.xml @@ -156,6 +156,8 @@ + + @@ -484,6 +486,26 @@ + + + + + + + + + + + + + + + + + diff --git a/solr_home/tmdb/conf/solrconfig.xml b/solr_home/tmdb/conf/solrconfig.xml index db94f1b..3e4fde1 100644 --- a/solr_home/tmdb/conf/solrconfig.xml +++ b/solr_home/tmdb/conf/solrconfig.xml @@ -57,6 +57,7 @@ --> + + + true + + + + + responseSink + querqy.solr.ResponseSink + + + + + replace_prelive + responseSink + + + + + replace + responseSink + + + + + common_rules_prelive + responseSink + + + + + common_rules + responseSink + + + + + regex_screen_protectors + responseSink + + + + + + + + + + + + text/javascript; charset=UTF-8