Skip to content
Browse files

reorg begins.

  • Loading branch information...
1 parent 9e9c191 commit 7dc5bac3bdf3632b2f66de9e142810182a5cbdee Robert Newson committed Sep 2, 2009
View
44 README.md
@@ -1,16 +1,12 @@
-<h1>WARNING</h1>
-
-<b>I strongly recommend using the 0.4 release</b> (available at <a href="http://cloud.github.com/downloads/rnewson/couchdb-lucene/couchdb-lucene-0.4-jar-with-dependencies.jar.gz">GitHub</a>) as the 0.5 work will occur on trunk and will definitely have extended periods of instability and broken-ness.
-
<h1>Issue Tracking</h1>
Issue tracking at <a href="http://github.com/rnewson/couchdb-lucene/issues">github</a>.
-<h1>System Requirements</h1>
+<h1>Minimum System Requirements</h1>
-Sun JDK 5 or higher is recommended.
+JDK6 is required; the Sun version is recommended as it's regularly tested against.
-Couchdb-lucene is known to be incompatible with some versions of OpenJDK as it includes an earlier, and incompatible, version of the Rhino Javascript library. The version in Ubuntu 8.10 (6b12-0ubuntu6.4) is known to work and it uses Rhino 1.7R1.
+10.5 is the minimum version of OSX for the above reason.
<h1>Build couchdb-lucene</h1>
@@ -28,10 +24,7 @@ Couchdb-lucene is known to be incompatible with some versions of OpenJDK as it i
os_process_timeout=60000 ; increase the timeout from 5 seconds.
[external]
-fti=/usr/bin/java -server -jar /path/to/couchdb-lucene*-jar-with-dependencies.jar -search
-
-[update_notification]
-indexer=/usr/bin/java -server -jar /path/to/couchdb-lucene*-jar-with-dependencies.jar -index
+fti=/usr/bin/java -server -jar /path/to/couchdb-lucene*-jar-with-dependencies.jar
[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}
@@ -473,22 +466,21 @@ You will need to restart CouchDB if you change couchdb-lucene source code but th
<h1>Configuration</h1>
-couchdb-lucene respects several system properties;
+couchdb-lucene is configured from the couchdb ini files
-<dl>
-<dt>couchdb.log.dir</dt><dd>specify the directory of the log file (which is called couchdb-lucene.log), defaults to the platform-specific temp directory.</dd>
-<dt>couchdb.lucene.dir</dt><dd>specify the path to the lucene indexes (the default is to make a directory called 'lucene' relative to couchdb's current working directory.</dd>
-<dt>couchdb.lucene.operator<dt><dd>specify the default boolean operator for queries. If not specified, the default is "OR". You can specify either "OR" or "AND".</dd>
-<dt>couchdb.url</dt><dd>the url to contact CouchDB with (default is "http://localhost:5984")</dd>
-</dl>
+<pre>
+[lucene]
+; Send lucene indexes elsewhere, defaults to hidden subdir under database_dir
+;lucene_dir=
-You can override these properties like this;
+; Send logs elsewhere, defaults to same dir as couchdb log file.
+;log_dir=
-<pre>
-fti=/usr/bin/java -Dcouchdb.lucene.dir=/tmp \
--cp /home/rnewson/Source/couchdb-lucene/target/classes:\
-/home/rnewson/Source/couchdb-lucene/target/dependency\
-com.github.rnewson.couchdb.lucene.Main
+; alter (soft) maximum ram for indexing.
+;max_ram=16
+
+; Specify the default operator for boolean queries. If not specified, or if the setting is not recognized, the defaul is "OR". The other choice is "AND".
+; default_boolean_operator="OR"
</pre>
<h2>Basic Authentication</h2>
@@ -499,7 +491,3 @@ If you put couchdb behind an authenticating proxy you can still configure couchd
<dt>couchdb.password</dt><dd>the password to authenticate with.</dd>
<dt>couchdb.user</dt><dd>the user to authenticate as.</dd>
</dl>
-
-<h2>IPv6</h2>
-
-The default for couchdb.url is problematic on an IPv6 system. Specify -Dcouchdb.url=http://[::1]:5984 to resolve it.
View
0 external-hook → couchdb-hook
File renamed without changes.
View
36 federation.rb
@@ -1,36 +0,0 @@
-#!/usr/bin/ruby
-
-require 'net/http'
-require 'json'
-
-servers = %w(localhost localhost)
-result = {}
-
-threads=[]
-for server in servers
- threads << Thread.new(server) do |url|
- h = Net::HTTP.new(url, 5984)
- resp = h.get('/' + ARGV[0] + '/_fti?' + ARGV[1])
- json = JSON.parse(resp.body)
-
- if (!result.has_key?('q')) then
- result = json
- else
- # Accounting
- result['total_rows'] += json['total_rows']
- # Merge in new rows
- result['rows'].concat json['rows']
- if json.has_key?('sort_order')
- result['rows'].sort!{|a,b| a['sort_order'] <=> b['sort_order']}
- else
- result['rows'].sort!{|b,a| [a['score'],a['_id']] <=> [b['score'],b['_id']]}
- end
- # Drop extraneous rows.
- result['rows'].slice!(result['limit']..result['rows'].size)
- end
- end
-end
-# Wait for all responses
-threads.each{|thr| thr.join}
-
-puts JSON.generate result
View
48 pom.xml
@@ -8,9 +8,26 @@
<version>0.5-SNAPSHOT</version>
<dependencies>
<dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.0</version>
+ </dependency>
+ <!-- Remove Rhino, use javax.script -->
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.7R1</version>
+ </dependency>
+ <!-- Remove Rhino, use javax.script -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-embedded</artifactId>
+ <version>${jetty-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>2.5.6</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -49,11 +66,6 @@
<version>${tika-version}</version>
</dependency>
<dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.7R1</version>
- </dependency>
- <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
@@ -74,6 +86,7 @@
<properties>
<lucene-version>2.9-SNAPSHOT</lucene-version>
<tika-version>0.4</tika-version>
+ <jetty-version>6.1.20</jetty-version>
</properties>
<repositories>
<repository>
@@ -119,19 +132,30 @@
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
- <source>1.5</source>
+ <source>1.6</source>
<showPackage>false</showPackage>
<links>
<link>http://java.sun.com/javase/6/docs/api/</link>
- <link>http://lucene.apache.org/java/2_4_0/api/core/</link>
+ <link>http://lucene.apache.org/java/2_4_1/api/core/</link>
</links>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty-version}</version>
+ <configuration>
+ <scanIntervalSeconds>5</scanIntervalSeconds>
+ <scanTargets>
+ <scanTarget>src/main/webapp/WEB-INF/applicationContext.xml</scanTarget>
+ </scanTargets>
+ </configuration>
+ </plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.6</source>
+ <target>1.6</target>
</configuration>
</plugin>
<plugin>
View
20 src/main/java/com/github/rnewson/couchdb/lucene/servlet/SearchServlet.java
@@ -0,0 +1,20 @@
+package com.github.rnewson.couchdb.lucene.servlet;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public final class SearchServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
+ throws ServletException, IOException {
+ super.doGet(req, resp);
+ }
+
+}
View
8 src/main/webapp/WEB-INF/applicationContext.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
+ "http://www.springframework.org/dtd/spring-beans.dtd">
+<beans>
+
+<bean id="httpClient" class="org.apache.http.impl.client.DefaultHttpClient"/>
+
+</beans>
View
23 src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,23 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<web-app>
+ <display-name>cl</display-name>
+
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>search</servlet-name>
+ <servlet-class>com.github.rnewson.couchdb.lucene.servlet.SearchServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>search</servlet-name>
+ <url-pattern>/search/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
View
3 start
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+java -jar start.jar couchdb-lucene.war

0 comments on commit 7dc5bac

Please sign in to comment.
Something went wrong with that request. Please try again.