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

Commit

Permalink
DATASOLR-208 - Upgrade to Solr 4.10.1 (requires Java 7)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christophstrobl committed Oct 29, 2014
1 parent c489008 commit 20f70a0
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 22 deletions.
24 changes: 21 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<commons.collections>3.2.1</commons.collections>
<commons.lang>3.1</commons.lang>
<httpcomponents>4.2.2</httpcomponents>
<solr>4.7.2</solr>
<solr>4.10.1</solr>
<springdata.commons>1.10.0.BUILD-SNAPSHOT</springdata.commons>
</properties>

Expand All @@ -50,7 +50,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand All @@ -61,7 +60,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring}</version>
</dependency>

<!-- SPRING DATA -->
Expand Down Expand Up @@ -241,6 +239,26 @@
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-rules</id>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
<configuration>
<rules>
<requireJavaVersion>
<version>[1.7,1.9)</version>
</requireJavaVersion>
</rules>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
<luceneMatchVersion>4.7</luceneMatchVersion>
<luceneMatchVersion>4.10.1</luceneMatchVersion>

<!-- <lib/> directives can be used to instruct Solr to load an Jars
<!-- <lib/> directives can be used to instruct Solr to load any Jars
identified and use them to resolve any "plugins" specified in
your solrconfig.xml or schema.xml (ie: Analyzers, Request
Handlers, etc...).
Expand Down Expand Up @@ -117,7 +117,23 @@
persistent, and doesn't work with replication.
-->
<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">


<!-- These will be used if you are using the solr.HdfsDirectoryFactory,
otherwise they will be ignored. If you don't plan on using hdfs,
you can safely remove this section. -->
<!-- The root directory that collection data should be written to. -->
<str name="solr.hdfs.home">${solr.hdfs.home:}</str>
<!-- The hadoop configuration files to use for the hdfs client. -->
<str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
<!-- Enable/Disable the hdfs cache. -->
<str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
<!-- Enable/Disable using one global cache for all SolrCores.
The settings used will be from the first HdfsDirectoryFactory created. -->
<str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>

</directoryFactory>

<!-- The CodecFactory for defining the format of the inverted index.
The default implementation is SchemaCodecFactory, which is the official Lucene
Expand Down Expand Up @@ -312,6 +328,13 @@
this is enabled here, and controlled through log4j.properties.
-->
<infoStream>true</infoStream>

<!--
Use true to enable this safety check, which can help
reduce the risk of propagating index corruption from older segments
into new ones, at the expense of slower merging.
-->
<checkIntegrityAtMerge>false</checkIntegrityAtMerge>
</indexConfig>


Expand Down Expand Up @@ -898,7 +921,15 @@

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


<!--
The export request handler is used to export full sorted result sets.
Do not change these defaults.
-->

<requestHandler name="/export" class="solr.SearchHandler">
<lst name="invariants">
<str name="rq">{!xport}</str>
<str name="wt">xsort</str>
<str name="distrib">false</str>
</lst>

<arr name="components">
<str>query</str>
</arr>
</requestHandler>






<!-- A Robust Example
This example SearchHandler declaration shows off usage of the
Expand Down Expand Up @@ -948,6 +1000,7 @@

<!-- Faceting defaults -->
<str name="facet">on</str>
<str name="facet.missing">true</str>
<str name="facet.field">cat</str>
<str name="facet.field">manu_exact</str>
<str name="facet.field">content_type</str>
Expand Down Expand Up @@ -975,6 +1028,7 @@
<!-- Highlighting defaults -->
<str name="hl">on</str>
<str name="hl.fl">content features title name</str>
<str name="hl.preserveMulti">true</str>
<str name="hl.encoder">html</str>
<str name="hl.simple.pre">&lt;b&gt;</str>
<str name="hl.simple.post">&lt;/b&gt;</str>
Expand Down Expand Up @@ -1006,8 +1060,8 @@
</requestHandler>


<!-- Update Request Handler.
<!-- Update Request Handler.
http://wiki.apache.org/solr/UpdateXmlMessages
The canonical Request Handler for Modifying the Index through
Expand All @@ -1016,17 +1070,17 @@
Note: Since solr1.1 requestHandlers requires a valid content
type header if posted in the body. For example, curl now
requires: -H 'Content-type:text/xml; charset=utf-8'
To override the request content type and force a specific
Content-type, use the request parameter:
To override the request content type and force a specific
Content-type, use the request parameter:
?update.contentType=text/csv
This handler will pick a response format to match the input
if the 'wt' parameter is not explicit
-->
<requestHandler name="/update" class="solr.UpdateRequestHandler">
<!-- See below for information on defining
updateRequestProcessorChains that can be used by name
<!-- See below for information on defining
updateRequestProcessorChains that can be used by name
on each Update Request
-->
<!--
Expand All @@ -1036,17 +1090,18 @@
-->
</requestHandler>

<!-- for back compat with clients using /update/json and /update/csv -->
<requestHandler name="/update/json" class="solr.JsonUpdateRequestHandler">
<!-- The following are implicitly added
<requestHandler name="/update/json" class="solr.UpdateRequestHandler">
<lst name="defaults">
<str name="stream.contentType">application/json</str>
</lst>
</requestHandler>
<requestHandler name="/update/csv" class="solr.CSVRequestHandler">
<requestHandler name="/update/csv" class="solr.UpdateRequestHandler">
<lst name="defaults">
<str name="stream.contentType">application/csv</str>
</lst>
</requestHandler>
-->

<!-- Solr Cell Update Request Handler
Expand Down Expand Up @@ -1142,14 +1197,17 @@
<requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
-->
<!-- If you wish to hide files under ${solr.home}/conf, explicitly
register the ShowFileRequestHandler using:
register the ShowFileRequestHandler using the definition below.
NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
not exclude all files ending in '.xml'. Use it to exclude _all_ updates
-->
<!--
<requestHandler name="/admin/file"
class="solr.admin.ShowFileRequestHandler" >
<lst name="invariants">
<str name="hidden">synonyms.txt</str>
<str name="hidden">anotherfile.txt</str>
<str name="hidden">*</str>
</lst>
</requestHandler>
-->
Expand Down Expand Up @@ -1343,7 +1401,7 @@
</lst>
-->
</searchComponent>

<!-- A request handler for demonstrating the spellcheck component.
NOTE: This is purely as an example. The whole purpose of the
Expand Down Expand Up @@ -1381,6 +1439,26 @@
</arr>
</requestHandler>

<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">FuzzyLookupFactory</str> <!-- org.apache.solr.spelling.suggest.fst -->
<str name="dictionaryImpl">DocumentDictionaryFactory</str> <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
<str name="field">cat</str>
<str name="weightField">price</str>
<str name="suggestAnalyzerFieldType">string</str>
</lst>
</searchComponent>

<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
<!-- Term Vector Component
http://wiki.apache.org/solr/TermVectorComponent
Expand Down Expand Up @@ -1513,7 +1591,6 @@
<searchComponent name="terms" class="solr.TermsComponent"/>

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

0 comments on commit 20f70a0

Please sign in to comment.