Skip to content

Commit

Permalink
Initial Commit, all working 90% coverage, well not quite all working,…
Browse files Browse the repository at this point in the history
… a problem with the embedded server at the moment.
  • Loading branch information
ieb committed Dec 2, 2010
0 parents commit 92b92ec
Show file tree
Hide file tree
Showing 24 changed files with 3,621 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
h1. Solr Bundle for OSGi

h2. Rational

This bundle ofers Solr functionaliry in embeded form to an OSGi Container. It listens to the OSGi container for events indicating that
a resource has been updated and performs an indexing operation based on that update.

It also provides a search interface.




119 changes: 119 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>base</artifactId>
<groupId>org.sakaiproject.nakamura</groupId>
<version>0.10-SNAPSHOT</version>
</parent>
<groupId>org.sakaiproject.nakamura</groupId>
<artifactId>org.sakaiproject.nakamura.solr</artifactId>
<packaging>bundle</packaging>
<version>0.10-SNAPSHOT</version>
<name>Sakai Nakamura :: Solr based search service.</name>
<description>A Solr bundle that embeds Solr 4 into OSGi and makes an embeded server available or references a remote server.</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Category>sakai-nakamura</Bundle-Category>
<Export-Package>
org.sakaiproject.nakamura.api.solr.*
</Export-Package>
<Import-Package>
*
</Import-Package>
<Private-Package>org.sakaiproject.nakamura.solr.*</Private-Package>
<Embed-Dependency></Embed-Dependency>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
</dependency>



<!-- We also need slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>

<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>

<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.jcr.api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.json</artifactId>
<version>2.0.4-incubator</version>
</dependency>
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>0.8</version>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>

<!-- Since we will be running in OSGi we also include the following -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
10 changes: 10 additions & 0 deletions src/main/java/org/sakaiproject/nakamura/api/solr/Indexer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.sakaiproject.nakamura.api.solr;


public interface Indexer {

void removeHander(String key, IndexingHandler handler);

void addHandler(String key, IndexingHandler handler);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.sakaiproject.nakamura.api.solr;

import org.apache.solr.common.SolrInputDocument;
import org.osgi.service.event.Event;

import java.util.Collection;

import javax.jcr.Session;

public interface IndexingHandler {

Collection<SolrInputDocument> getDocuments(Session session, Event event);

Collection<String> getDeleteQueries(Session session, Event event);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.sakaiproject.nakamura.api.solr;

public interface ResourceIndexingService extends Indexer {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.sakaiproject.nakamura.api.solr;

import org.apache.solr.client.solrj.SolrServer;

public interface SolrServerService {

SolrServer getServer();

String getSolrHome();

}
Loading

0 comments on commit 92b92ec

Please sign in to comment.