-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Commit, all working 90% coverage, well not quite all working,…
… a problem with the embedded server at the moment.
- Loading branch information
0 parents
commit 92b92ec
Showing
24 changed files
with
3,621 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
src/main/java/org/sakaiproject/nakamura/api/solr/Indexer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/org/sakaiproject/nakamura/api/solr/IndexingHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/org/sakaiproject/nakamura/api/solr/ResourceIndexingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/org/sakaiproject/nakamura/api/solr/SolrServerService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
|
||
} |
Oops, something went wrong.