Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 20f70a0

Browse files
DATASOLR-208 - Upgrade to Solr 4.10.1 (requires Java 7)
Source code remains Java 6 compatible though we now required at least Java 7 to run the build. In case running on Java 7/8 is not an option one has to plug in a solrj version prior to 4.8.
1 parent c489008 commit 20f70a0

File tree

2 files changed

+117
-22
lines changed

2 files changed

+117
-22
lines changed

pom.xml

+21-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<commons.collections>3.2.1</commons.collections>
2424
<commons.lang>3.1</commons.lang>
2525
<httpcomponents>4.2.2</httpcomponents>
26-
<solr>4.7.2</solr>
26+
<solr>4.10.1</solr>
2727
<springdata.commons>1.10.0.BUILD-SNAPSHOT</springdata.commons>
2828
</properties>
2929

@@ -50,7 +50,6 @@
5050
<dependency>
5151
<groupId>org.springframework</groupId>
5252
<artifactId>spring-context</artifactId>
53-
<version>${spring}</version>
5453
<exclusions>
5554
<exclusion>
5655
<groupId>commons-logging</groupId>
@@ -61,7 +60,6 @@
6160
<dependency>
6261
<groupId>org.springframework</groupId>
6362
<artifactId>spring-tx</artifactId>
64-
<version>${spring}</version>
6563
</dependency>
6664

6765
<!-- SPRING DATA -->
@@ -241,6 +239,26 @@
241239
<groupId>org.asciidoctor</groupId>
242240
<artifactId>asciidoctor-maven-plugin</artifactId>
243241
</plugin>
242+
<plugin>
243+
<groupId>org.apache.maven.plugins</groupId>
244+
<artifactId>maven-enforcer-plugin</artifactId>
245+
<version>1.3.1</version>
246+
<executions>
247+
<execution>
248+
<id>enforce-rules</id>
249+
<goals>
250+
<goal>enforce</goal>
251+
</goals>
252+
</execution>
253+
</executions>
254+
<configuration>
255+
<rules>
256+
<requireJavaVersion>
257+
<version>[1.7,1.9)</version>
258+
</requireJavaVersion>
259+
</rules>
260+
</configuration>
261+
</plugin>
244262
</plugins>
245263
</build>
246264

src/test/resources/org/springframework/data/solr/collection1/conf/solrconfig.xml

+96-19
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
that you fully re-index after changing this setting as it can
3636
affect both how text is indexed and queried.
3737
-->
38-
<luceneMatchVersion>4.7</luceneMatchVersion>
38+
<luceneMatchVersion>4.10.1</luceneMatchVersion>
3939

40-
<!-- <lib/> directives can be used to instruct Solr to load an Jars
40+
<!-- <lib/> directives can be used to instruct Solr to load any Jars
4141
identified and use them to resolve any "plugins" specified in
4242
your solrconfig.xml or schema.xml (ie: Analyzers, Request
4343
Handlers, etc...).
@@ -117,7 +117,23 @@
117117
persistent, and doesn't work with replication.
118118
-->
119119
<directoryFactory name="DirectoryFactory"
120-
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
120+
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
121+
122+
123+
<!-- These will be used if you are using the solr.HdfsDirectoryFactory,
124+
otherwise they will be ignored. If you don't plan on using hdfs,
125+
you can safely remove this section. -->
126+
<!-- The root directory that collection data should be written to. -->
127+
<str name="solr.hdfs.home">${solr.hdfs.home:}</str>
128+
<!-- The hadoop configuration files to use for the hdfs client. -->
129+
<str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
130+
<!-- Enable/Disable the hdfs cache. -->
131+
<str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
132+
<!-- Enable/Disable using one global cache for all SolrCores.
133+
The settings used will be from the first HdfsDirectoryFactory created. -->
134+
<str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
135+
136+
</directoryFactory>
121137

122138
<!-- The CodecFactory for defining the format of the inverted index.
123139
The default implementation is SchemaCodecFactory, which is the official Lucene
@@ -312,6 +328,13 @@
312328
this is enabled here, and controlled through log4j.properties.
313329
-->
314330
<infoStream>true</infoStream>
331+
332+
<!--
333+
Use true to enable this safety check, which can help
334+
reduce the risk of propagating index corruption from older segments
335+
into new ones, at the expense of slower merging.
336+
-->
337+
<checkIntegrityAtMerge>false</checkIntegrityAtMerge>
315338
</indexConfig>
316339

317340

@@ -898,7 +921,15 @@
898921

899922
<!-- realtime get handler, guaranteed to return the latest stored fields of
900923
any document, without the need to commit or open a new searcher. The
901-
current implementation relies on the updateLog feature being enabled. -->
924+
current implementation relies on the updateLog feature being enabled.
925+
926+
** WARNING **
927+
Do NOT disable the realtime get handler at /get if you are using
928+
SolrCloud otherwise any leader election will cause a full sync in ALL
929+
replicas for the shard in question. Similarly, a replica recovery will
930+
also always fetch the complete index from the leader because a partial
931+
sync will not be possible in the absence of this handler.
932+
-->
902933
<requestHandler name="/get" class="solr.RealTimeGetHandler">
903934
<lst name="defaults">
904935
<str name="omitHeader">true</str>
@@ -907,7 +938,28 @@
907938
</lst>
908939
</requestHandler>
909940

910-
941+
<!--
942+
The export request handler is used to export full sorted result sets.
943+
Do not change these defaults.
944+
-->
945+
946+
<requestHandler name="/export" class="solr.SearchHandler">
947+
<lst name="invariants">
948+
<str name="rq">{!xport}</str>
949+
<str name="wt">xsort</str>
950+
<str name="distrib">false</str>
951+
</lst>
952+
953+
<arr name="components">
954+
<str>query</str>
955+
</arr>
956+
</requestHandler>
957+
958+
959+
960+
961+
962+
911963
<!-- A Robust Example
912964
913965
This example SearchHandler declaration shows off usage of the
@@ -948,6 +1000,7 @@
9481000

9491001
<!-- Faceting defaults -->
9501002
<str name="facet">on</str>
1003+
<str name="facet.missing">true</str>
9511004
<str name="facet.field">cat</str>
9521005
<str name="facet.field">manu_exact</str>
9531006
<str name="facet.field">content_type</str>
@@ -975,6 +1028,7 @@
9751028
<!-- Highlighting defaults -->
9761029
<str name="hl">on</str>
9771030
<str name="hl.fl">content features title name</str>
1031+
<str name="hl.preserveMulti">true</str>
9781032
<str name="hl.encoder">html</str>
9791033
<str name="hl.simple.pre">&lt;b&gt;</str>
9801034
<str name="hl.simple.post">&lt;/b&gt;</str>
@@ -1006,8 +1060,8 @@
10061060
</requestHandler>
10071061

10081062

1009-
<!-- Update Request Handler.
1010-
1063+
<!-- Update Request Handler.
1064+
10111065
http://wiki.apache.org/solr/UpdateXmlMessages
10121066
10131067
The canonical Request Handler for Modifying the Index through
@@ -1016,17 +1070,17 @@
10161070
Note: Since solr1.1 requestHandlers requires a valid content
10171071
type header if posted in the body. For example, curl now
10181072
requires: -H 'Content-type:text/xml; charset=utf-8'
1019-
1020-
To override the request content type and force a specific
1021-
Content-type, use the request parameter:
1073+
1074+
To override the request content type and force a specific
1075+
Content-type, use the request parameter:
10221076
?update.contentType=text/csv
1023-
1077+
10241078
This handler will pick a response format to match the input
10251079
if the 'wt' parameter is not explicit
10261080
-->
10271081
<requestHandler name="/update" class="solr.UpdateRequestHandler">
1028-
<!-- See below for information on defining
1029-
updateRequestProcessorChains that can be used by name
1082+
<!-- See below for information on defining
1083+
updateRequestProcessorChains that can be used by name
10301084
on each Update Request
10311085
-->
10321086
<!--
@@ -1036,17 +1090,18 @@
10361090
-->
10371091
</requestHandler>
10381092

1039-
<!-- for back compat with clients using /update/json and /update/csv -->
1040-
<requestHandler name="/update/json" class="solr.JsonUpdateRequestHandler">
1093+
<!-- The following are implicitly added
1094+
<requestHandler name="/update/json" class="solr.UpdateRequestHandler">
10411095
<lst name="defaults">
10421096
<str name="stream.contentType">application/json</str>
10431097
</lst>
10441098
</requestHandler>
1045-
<requestHandler name="/update/csv" class="solr.CSVRequestHandler">
1099+
<requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
10461100
<lst name="defaults">
10471101
<str name="stream.contentType">application/csv</str>
10481102
</lst>
10491103
</requestHandler>
1104+
-->
10501105

10511106
<!-- Solr Cell Update Request Handler
10521107
@@ -1142,14 +1197,17 @@
11421197
<requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
11431198
-->
11441199
<!-- If you wish to hide files under ${solr.home}/conf, explicitly
1145-
register the ShowFileRequestHandler using:
1200+
register the ShowFileRequestHandler using the definition below.
1201+
NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
1202+
not exclude all files ending in '.xml'. Use it to exclude _all_ updates
11461203
-->
11471204
<!--
11481205
<requestHandler name="/admin/file"
11491206
class="solr.admin.ShowFileRequestHandler" >
11501207
<lst name="invariants">
11511208
<str name="hidden">synonyms.txt</str>
11521209
<str name="hidden">anotherfile.txt</str>
1210+
<str name="hidden">*</str>
11531211
</lst>
11541212
</requestHandler>
11551213
-->
@@ -1343,7 +1401,7 @@
13431401
</lst>
13441402
-->
13451403
</searchComponent>
1346-
1404+
13471405
<!-- A request handler for demonstrating the spellcheck component.
13481406
13491407
NOTE: This is purely as an example. The whole purpose of the
@@ -1381,6 +1439,26 @@
13811439
</arr>
13821440
</requestHandler>
13831441

1442+
<searchComponent name="suggest" class="solr.SuggestComponent">
1443+
<lst name="suggester">
1444+
<str name="name">mySuggester</str>
1445+
<str name="lookupImpl">FuzzyLookupFactory</str> <!-- org.apache.solr.spelling.suggest.fst -->
1446+
<str name="dictionaryImpl">DocumentDictionaryFactory</str> <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
1447+
<str name="field">cat</str>
1448+
<str name="weightField">price</str>
1449+
<str name="suggestAnalyzerFieldType">string</str>
1450+
</lst>
1451+
</searchComponent>
1452+
1453+
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
1454+
<lst name="defaults">
1455+
<str name="suggest">true</str>
1456+
<str name="suggest.count">10</str>
1457+
</lst>
1458+
<arr name="components">
1459+
<str>suggest</str>
1460+
</arr>
1461+
</requestHandler>
13841462
<!-- Term Vector Component
13851463
13861464
http://wiki.apache.org/solr/TermVectorComponent
@@ -1513,7 +1591,6 @@
15131591
<searchComponent name="terms" class="solr.TermsComponent"/>
15141592

15151593
<!-- A request handler for demonstrating the terms component -->
1516-
<requestHandler name="/js" class="org.apache.solr.handler.js.JavaScriptRequestHandler" startup="lazy"/>
15171594
<requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
15181595
<lst name="defaults">
15191596
<bool name="terms">true</bool>

0 commit comments

Comments
 (0)