DATAREST-1044 - Update Solr test module after changes in Spring Data Solr.
Update to Solr 6.5 and adapt schema and request handlers.
This commit is contained in:
committed by
Oliver Gierke
parent
03d5cbead5
commit
d88240e13b
@@ -34,10 +34,16 @@
|
||||
<version>${jackson}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.solr</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<version>5.5.0</version>
|
||||
<version>6.5.0</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
||||
@@ -53,6 +53,7 @@ import org.xml.sax.SAXException;
|
||||
public class SolrInfrastructureConfig {
|
||||
|
||||
private static final String CORE_PROPERTIES = "name=collection1";
|
||||
private static final Resource MANAGED_SCHEMA = new ClassPathResource("managed-schema", SolrInfrastructureConfig.class);
|
||||
private static final Resource SOLR_CONFIG = new ClassPathResource("solrconfig.xml", SolrInfrastructureConfig.class);
|
||||
private static final Resource SOLR_SCHEMA = new ClassPathResource("schema.xml", SolrInfrastructureConfig.class);
|
||||
private static final Resource SOLR_XML = new ClassPathResource("solr.xml", SolrInfrastructureConfig.class);
|
||||
@@ -81,6 +82,7 @@ public class SolrInfrastructureConfig {
|
||||
Resource solrConfig = filterResource(SOLR_CONFIG, configParams);
|
||||
Resource solrSchema = SOLR_SCHEMA;
|
||||
Resource solrXml = SOLR_XML;
|
||||
Resource solrManagedSchema = MANAGED_SCHEMA;
|
||||
|
||||
File solrHomeDir = new File(solrHomePath);
|
||||
File collectionDir = new File(solrHomeDir, "collection1");
|
||||
@@ -90,6 +92,7 @@ public class SolrInfrastructureConfig {
|
||||
FileCopyUtils.copy(solrXml.getInputStream(), new FileOutputStream(createFile(solrHomeDir, "solr.xml")));
|
||||
FileCopyUtils.copy(CORE_PROPERTIES.getBytes(), new FileOutputStream(createFile(collectionDir, "core.properties")));
|
||||
FileCopyUtils.copy(solrSchema.getInputStream(), new FileOutputStream(createFile(confDir, "schema.xml")));
|
||||
FileCopyUtils.copy(solrManagedSchema.getInputStream(), new FileOutputStream(createFile(confDir, "managed-schema")));
|
||||
FileCopyUtils.copy(solrConfig.getInputStream(), new FileOutputStream(createFile(confDir, "solrconfig.xml")));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schema name="minimal" version="1.1">
|
||||
<types>
|
||||
<fieldType name="string" class="solr.StrField" />
|
||||
</types>
|
||||
<fields>
|
||||
<field name="id" type="string" indexed="true" stored="true" required="true" />
|
||||
<field name="name" type="string" indexed="true" stored="true" />
|
||||
<field name="cat" type="string" indexed="true" stored="true" multiValued="true" />
|
||||
</fields>
|
||||
<uniqueKey>id</uniqueKey>
|
||||
</schema>
|
||||
@@ -16,7 +16,5 @@
|
||||
<str name="df">text</str>
|
||||
</lst>
|
||||
</requestHandler>
|
||||
<requestHandler name="/admin/"
|
||||
class="org.apache.solr.handler.admin.AdminHandlers" />
|
||||
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
|
||||
</config>
|
||||
|
||||
Reference in New Issue
Block a user