[25903] | 1 | README file for Greenstone 3's Solr extension
|
---|
| 2 |
|
---|
[25906] | 3 | CONTENTS OF THIS README
|
---|
| 4 | - Acquiring and setting up the Solr extension
|
---|
| 5 | - Importing and (re-)building a collection with the Solr extension
|
---|
| 6 | - Running the Solr extension's Jetty server on its own
|
---|
| 7 | - Some handy manual commands
|
---|
| 8 | - Adding new Java classes into the Solr extension
|
---|
[25903] | 9 |
|
---|
[25906] | 10 |
|
---|
[25903] | 11 | ACQUIRING AND SETTING UP THE SOLR EXTENSION
|
---|
| 12 |
|
---|
| 13 | 1. SVN checkout the solr extension's src folder into the top-level ext directory of a Greenstone 3 installation, under the name "solr":
|
---|
| 14 |
|
---|
| 15 | $gs3> cd ext
|
---|
| 16 | $gs3> svn co http://svn.greenstone.org/gs3-extensions/solr/trunk/src solr
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | 2. Next run the add-service ant target in the solr extension just checked out, which will set up solr (the del-service will undo this setup if ever required):
|
---|
| 20 |
|
---|
| 21 | $gs3/ext> cd solr
|
---|
| 22 | $gs3/ext/solr> ant add-service
|
---|
| 23 |
|
---|
[28099] | 24 | 3. The solr-jdbm-demo collection is copied into localsite's collect folder as part of the install.
|
---|
[25903] | 25 |
|
---|
[28183] | 26 | 4. Alternatively, edit an existing collection's etc/collectionConfig.xml, setting the search type to be solr. You may want to set up sort fields and facet fields, see solr-jdbm-demo collectionConfig.xml for examples.
|
---|
[25903] | 27 |
|
---|
| 28 | 5. Run the GS3 tomcat server:
|
---|
| 29 | $gs3> ant start
|
---|
| 30 |
|
---|
[28183] | 31 | 6. View your SOLR collections.
|
---|
[25903] | 32 |
|
---|
| 33 | IMPORTING AND (RE-)BUILDING A COLLECTION WITH SOLR
|
---|
| 34 |
|
---|
| 35 | 1. Set up the environment for Greenstone 3 first to have access to the build-scripts:
|
---|
| 36 |
|
---|
| 37 | $gs3> gs3-setup.bat / source gs3-setup.sh
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | 2a. For a full rebuild (without -removeold it defaults to -removeold anyway), with or without the Greenstone3 server already running, type the following commands in succession:
|
---|
| 41 |
|
---|
| 42 | $gs3> perl -S import.pl [-removeold] -site localsite <colname>
|
---|
| 43 | $gs3> perl -S buildcol.pl [-removeold] -site localsite <colname>
|
---|
| 44 | $gs3> perl -S activate.pl [-removeold] -site localsite <colname>
|
---|
| 45 |
|
---|
| 46 | OR:
|
---|
| 47 | $gs3> perl -S import.pl [-removeold] -site localsite <colname>
|
---|
| 48 | $gs3> perl -S buildcol.pl [-removeold] -activate -site localsite <colname>
|
---|
| 49 |
|
---|
| 50 | OR:
|
---|
| 51 | $gs3> perl -S full-rebuild.pl -site localsite <colname>
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | 2b. For an incremental rebuild, with or without the Greenstone3 server already running:
|
---|
| 55 |
|
---|
| 56 | $gs3> perl -S incremental-import.pl -site localsite <colname>
|
---|
| 57 | $gs3> perl -S incremental-buildcol.pl -site localsite <colname>
|
---|
| 58 | $gs3> perl -S activate.pl -incremental -site localsite <colname>
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | 3. Preview the collection. If the Greenstone3 server wasn't already running, start it up first:
|
---|
| 62 | $gs3> ant start
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | RUNNING THE SOLR EXTENSION'S JETTY SERVER ON ITS OWN
|
---|
| 66 |
|
---|
| 67 | 1. Ensure the environment for Greenstone 3 is set up, if you haven't already done so:
|
---|
| 68 |
|
---|
| 69 | $gs3> gs3-setup.bat / source gs3-setup.sh
|
---|
| 70 |
|
---|
| 71 |
|
---|
| 72 | 2. Run the solr extension's jetty server in standalone mode:
|
---|
| 73 | $gs3> perl -S run_solr_server.pl start <optional stopkey>
|
---|
| 74 |
|
---|
| 75 | If no stopkey is provided, it will use "standalone-greenstone-solr" as the stopkey.
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 | 3. Visit the running Solr Admin page for an index of your solr collection, which tends to be run on port 8983:
|
---|
| 79 | http://localhost:8983/solr/localsite-<colname>-<indexlevel>/admin
|
---|
| 80 |
|
---|
| 81 | E.g. http://localhost:8983/solr/localsite-solr-jdbm-demo-didx/admin
|
---|
| 82 | http://localhost:8983/solr/localsite-solr-jdbm-demo-sidx/admin
|
---|
| 83 |
|
---|
| 84 | Search each index on the default search pattern (*:*) to see if documents have been properly indexed by solr.
|
---|
| 85 | If that's the case, an XML listing the number of responses and some metadata for each should be returned.
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | 4. To stop a running solr extension jetty server that has been run in standalone mode. Pass in the same stopkey if you provided any during start:
|
---|
| 89 |
|
---|
| 90 | $gs3> perl -S run_solr_server.pl stop <optional stopkey>
|
---|
| 91 |
|
---|
| 92 |
|
---|
[25906] | 93 | SOME HANDY MANUAL COMMANDS
|
---|
[25903] | 94 | The commands expressed below are for Linux, adjust them for Windows
|
---|
| 95 |
|
---|
| 96 | 1. Manually running the solr extension's jetty server:
|
---|
| 97 |
|
---|
| 98 | $gs3/ext/solr> java -Dsolr.solr.home=`pwd` -jar lib/java/solr-jetty-server.jar
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | 2. Manually getting this running solr server to index a greenstone collection's documents:
|
---|
| 102 |
|
---|
| 103 | $gs3/ext/solr> java -Dsolr.solr.home=`pwd` -Durl=http://localhost:8983/solr/localsite-solr-jdbm-demo-didx/update -jar lib/java/solr-post.jar
|
---|
| 104 |
|
---|
| 105 | The above posts the solr-jdbm-demo collection's didx (document-level) index folder contents to Solr to be ingested.
|
---|
| 106 |
|
---|
[25906] | 107 |
|
---|
| 108 | ADDING NEW JAVA CLASSES INTO THE SOLR EXTENSION
|
---|
| 109 |
|
---|
[28099] | 110 | 1. Create the Java classes and place them into their package within the ext/solr/src/java location. They can then be compiled by running 'ant compile' in the ext/solr folder.
|
---|
[25906] | 111 |
|
---|
| 112 |
|
---|
[28099] | 113 |
|
---|