source: gs3-extensions/solr/trunk/src/README.txt@ 28099

Last change on this file since 28099 was 28099, checked in by kjdon, 11 years ago

some changes to do with new compile-in-place strategy

File size: 4.6 KB
Line 
1README file for Greenstone 3's Solr extension
2
3CONTENTS 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
9
10
11ACQUIRING AND SETTING UP THE SOLR EXTENSION
12
131. 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
192. 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
243. The solr-jdbm-demo collection is copied into localsite's collect folder as part of the install.
25
264. Edit a collection's etc/collectionConfig.xml, setting the search type to be solr.
27
28For 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:
29
30<displayItem assigned="true" lang="en" name="name">Solr/JDBM demo</displayItem>
31<search type="solr">
32
33(For this collection, references to dc.Title in the collectionConfig.xml may need to become or be preceded by references to dls.Title)
34
35
365. Run the GS3 tomcat server:
37$gs3> ant start
38
39
40IMPORTING AND (RE-)BUILDING A COLLECTION WITH SOLR
41
421. Set up the environment for Greenstone 3 first to have access to the build-scripts:
43
44$gs3> gs3-setup.bat / source gs3-setup.sh
45
46
472a. 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:
48
49$gs3> perl -S import.pl [-removeold] -site localsite <colname>
50$gs3> perl -S buildcol.pl [-removeold] -site localsite <colname>
51$gs3> perl -S activate.pl [-removeold] -site localsite <colname>
52
53OR:
54$gs3> perl -S import.pl [-removeold] -site localsite <colname>
55$gs3> perl -S buildcol.pl [-removeold] -activate -site localsite <colname>
56
57OR:
58$gs3> perl -S full-rebuild.pl -site localsite <colname>
59
60
612b. For an incremental rebuild, with or without the Greenstone3 server already running:
62
63$gs3> perl -S incremental-import.pl -site localsite <colname>
64$gs3> perl -S incremental-buildcol.pl -site localsite <colname>
65$gs3> perl -S activate.pl -incremental -site localsite <colname>
66
67
683. Preview the collection. If the Greenstone3 server wasn't already running, start it up first:
69$gs3> ant start
70
71
72RUNNING THE SOLR EXTENSION'S JETTY SERVER ON ITS OWN
73
741. Ensure the environment for Greenstone 3 is set up, if you haven't already done so:
75
76$gs3> gs3-setup.bat / source gs3-setup.sh
77
78
792. Run the solr extension's jetty server in standalone mode:
80$gs3> perl -S run_solr_server.pl start <optional stopkey>
81
82If no stopkey is provided, it will use "standalone-greenstone-solr" as the stopkey.
83
84
853. Visit the running Solr Admin page for an index of your solr collection, which tends to be run on port 8983:
86 http://localhost:8983/solr/localsite-<colname>-<indexlevel>/admin
87
88E.g. http://localhost:8983/solr/localsite-solr-jdbm-demo-didx/admin
89 http://localhost:8983/solr/localsite-solr-jdbm-demo-sidx/admin
90
91Search each index on the default search pattern (*:*) to see if documents have been properly indexed by solr.
92If that's the case, an XML listing the number of responses and some metadata for each should be returned.
93
94
954. 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:
96
97$gs3> perl -S run_solr_server.pl stop <optional stopkey>
98
99
100SOME HANDY MANUAL COMMANDS
101The commands expressed below are for Linux, adjust them for Windows
102
1031. Manually running the solr extension's jetty server:
104
105$gs3/ext/solr> java -Dsolr.solr.home=`pwd` -jar lib/java/solr-jetty-server.jar
106
107
1082. Manually getting this running solr server to index a greenstone collection's documents:
109
110$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
111
112The above posts the solr-jdbm-demo collection's didx (document-level) index folder contents to Solr to be ingested.
113
114
115ADDING NEW JAVA CLASSES INTO THE SOLR EXTENSION
116
1171. 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.
118
119
120
Note: See TracBrowser for help on using the repository browser.