|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+.. _solr-debian-installing:
|
|
|
2
|
+
|
|
|
3
|
+Search within Oscar
|
|
|
4
|
+*******************
|
|
|
5
|
+
|
|
|
6
|
+Oscar makes use of Solr for searching, faceting and 'more like this' handling.
|
|
|
7
|
+
|
|
|
8
|
+This guide details the process of install solr on debian based systems.
|
|
|
9
|
+
|
|
|
10
|
+
|
|
|
11
|
+Installing Solr
|
|
|
12
|
+===============
|
|
|
13
|
+
|
|
|
14
|
+Solr is a java application which needs to run inside a Java servlet container (e.g. Tomcat).
|
|
|
15
|
+On Debian based system (including Ubuntu) you can install it directly from the apt repository::
|
|
|
16
|
+
|
|
|
17
|
+ $ apt-get install solr-tomcat
|
|
|
18
|
+
|
|
|
19
|
+.. _solr-debian-configuring:
|
|
|
20
|
+
|
|
|
21
|
+Configuring Solr
|
|
|
22
|
+================
|
|
|
23
|
+
|
|
|
24
|
+1. Export the solr schema from the project::
|
|
|
25
|
+
|
|
|
26
|
+ $ ./manage.py build_solr_schema > schema.xml
|
|
|
27
|
+
|
|
|
28
|
+2. copy ``schema.xml`` over existing solr ``schema.xml``::
|
|
|
29
|
+
|
|
|
30
|
+ $ cp schema.xml /etc/solr/conf/schema.xml
|
|
|
31
|
+
|
|
|
32
|
+3. Enable the ``More Like This`` request handler::
|
|
|
33
|
+
|
|
|
34
|
+ $ vim /etc/solr/conf/solrconfig.xml
|
|
|
35
|
+
|
|
|
36
|
+4. Add the following somewhere before the final closing tag::
|
|
|
37
|
+
|
|
|
38
|
+ <requestHandler name="/mlt" class="org.apache.solr.handler.MoreLikeThisHandler">
|
|
|
39
|
+ <lst name="defaults">
|
|
|
40
|
+ <str name="mlt.interestingTerms">list</str>
|
|
|
41
|
+ </lst>
|
|
|
42
|
+ </requestHandler>
|
|
|
43
|
+
|
|
|
44
|
+5. Restart tomcat::
|
|
|
45
|
+
|
|
|
46
|
+ $ /etc/init.d/tomcat6 restart
|
|
|
47
|
+
|
|
|
48
|
+6. Rebuild the complete index::
|
|
|
49
|
+
|
|
|
50
|
+ $ ./manage.py rebuild_index
|
|
|
51
|
+
|
|
|
52
|
+You can also update the index with::
|
|
|
53
|
+
|
|
|
54
|
+ $ ./manage.py update_index
|