1 | README file for Greenstone 3's Solr extension
|
---|
2 |
|
---|
3 |
|
---|
4 | ACQUIRING AND SETTING UP THE SOLR EXTENSION
|
---|
5 |
|
---|
6 | 1. SVN checkout the solr extension's src folder into the top-level ext directory of a Greenstone 3 installation, under the name "solr":
|
---|
7 |
|
---|
8 | $gs3> cd ext
|
---|
9 | $gs3> svn co http://svn.greenstone.org/gs3-extensions/solr/trunk/src solr
|
---|
10 |
|
---|
11 |
|
---|
12 | 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):
|
---|
13 |
|
---|
14 | $gs3/ext> cd solr
|
---|
15 | $gs3/ext/solr> ant add-service
|
---|
16 |
|
---|
17 |
|
---|
18 | 3. Compile up Greenstone 3's core java classes:
|
---|
19 | $gs3/ext/solr> cd ../..
|
---|
20 | $gs3> ant compile-core
|
---|
21 |
|
---|
22 |
|
---|
23 | 4. Edit a collection's etc/collectionConfig.xml, setting the search type to be solr.
|
---|
24 |
|
---|
25 | For instance, copy the (Lucene) Demo Collection of Greenstone 3 and rename it as Solr-JDBM-Demo. Next open etc/collectionConfig.xml in an editor and adjust the display name of the collection and then set the search type attribute to solr:
|
---|
26 |
|
---|
27 | <displayItem assigned="true" lang="en" name="name">Solr/JDBM demo</displayItem>
|
---|
28 | <search type="solr">
|
---|
29 |
|
---|
30 | (For this collection, references to dc.Title in the collectionConfig.xml may need to become or be preceded by references to dls.Title)
|
---|
31 |
|
---|
32 |
|
---|
33 | 5. Run the GS3 tomcat server:
|
---|
34 | $gs3> ant start
|
---|
35 |
|
---|
36 |
|
---|
37 | IMPORTING AND (RE-)BUILDING A COLLECTION WITH SOLR
|
---|
38 |
|
---|
39 | 1. Set up the environment for Greenstone 3 first to have access to the build-scripts:
|
---|
40 |
|
---|
41 | $gs3> gs3-setup.bat / source gs3-setup.sh
|
---|
42 |
|
---|
43 |
|
---|
44 | 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:
|
---|
45 |
|
---|
46 | $gs3> perl -S import.pl [-removeold] -site localsite <colname>
|
---|
47 | $gs3> perl -S buildcol.pl [-removeold] -site localsite <colname>
|
---|
48 | $gs3> perl -S activate.pl [-removeold] -site localsite <colname>
|
---|
49 |
|
---|
50 | OR:
|
---|
51 | $gs3> perl -S import.pl [-removeold] -site localsite <colname>
|
---|
52 | $gs3> perl -S buildcol.pl [-removeold] -activate -site localsite <colname>
|
---|
53 |
|
---|
54 | OR:
|
---|
55 | $gs3> perl -S full-rebuild.pl -site localsite <colname>
|
---|
56 |
|
---|
57 |
|
---|
58 | 2b. For an incremental rebuild, with or without the Greenstone3 server already running:
|
---|
59 |
|
---|
60 | $gs3> perl -S incremental-import.pl -site localsite <colname>
|
---|
61 | $gs3> perl -S incremental-buildcol.pl -site localsite <colname>
|
---|
62 | $gs3> perl -S activate.pl -incremental -site localsite <colname>
|
---|
63 |
|
---|
64 |
|
---|
65 | 3. Preview the collection. If the Greenstone3 server wasn't already running, start it up first:
|
---|
66 | $gs3> ant start
|
---|
67 |
|
---|
68 |
|
---|
69 | RUNNING THE SOLR EXTENSION'S JETTY SERVER ON ITS OWN
|
---|
70 |
|
---|
71 | 1. Ensure the environment for Greenstone 3 is set up, if you haven't already done so:
|
---|
72 |
|
---|
73 | $gs3> gs3-setup.bat / source gs3-setup.sh
|
---|
74 |
|
---|
75 |
|
---|
76 | 2. Run the solr extension's jetty server in standalone mode:
|
---|
77 | $gs3> perl -S run_solr_server.pl start <optional stopkey>
|
---|
78 |
|
---|
79 | If no stopkey is provided, it will use "standalone-greenstone-solr" as the stopkey.
|
---|
80 |
|
---|
81 |
|
---|
82 | 3. Visit the running Solr Admin page for an index of your solr collection, which tends to be run on port 8983:
|
---|
83 | http://localhost:8983/solr/localsite-<colname>-<indexlevel>/admin
|
---|
84 |
|
---|
85 | E.g. http://localhost:8983/solr/localsite-solr-jdbm-demo-didx/admin
|
---|
86 | http://localhost:8983/solr/localsite-solr-jdbm-demo-sidx/admin
|
---|
87 |
|
---|
88 | Search each index on the default search pattern (*:*) to see if documents have been properly indexed by solr.
|
---|
89 | If that's the case, an XML listing the number of responses and some metadata for each should be returned.
|
---|
90 |
|
---|
91 |
|
---|
92 | 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:
|
---|
93 |
|
---|
94 | $gs3> perl -S run_solr_server.pl stop <optional stopkey>
|
---|
95 |
|
---|
96 |
|
---|
97 | SOME HANDY MANUAL COMMANDS:
|
---|
98 | The commands expressed below are for Linux, adjust them for Windows
|
---|
99 |
|
---|
100 | 1. Manually running the solr extension's jetty server:
|
---|
101 |
|
---|
102 | $gs3/ext/solr> java -Dsolr.solr.home=`pwd` -jar lib/java/solr-jetty-server.jar
|
---|
103 |
|
---|
104 |
|
---|
105 | 2. Manually getting this running solr server to index a greenstone collection's documents:
|
---|
106 |
|
---|
107 | $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
|
---|
108 |
|
---|
109 | The above posts the solr-jdbm-demo collection's didx (document-level) index folder contents to Solr to be ingested.
|
---|
110 |
|
---|